As I have open the following URL before login.

User login

From my browser cache so it shows me login page. But I strange to see that it also shows my user name on the top with reputation and badges. How is it possible? It's so strange.


but after login if I select same url it redirect me to stackoverflow.com.

enter image description here

And if I am already logged in then why it shows me login page. It should redirect me from login page if I am already logged in.

if its for switching new user then it should show me message like do you want to switch new user? like that

I cant understand what it happens for please explain

  • 1
    Because you were already logged in. You didn't require to login.
    – Himanshu
    Apr 23, 2013 at 4:46
  • Since you asked to be sent to the login page, that's where you were taken. Where would you have liked to be redirected? The fact you were logged in has nothing to do with it (SO remembers your from one session to the next - cookies anyone?)
    – Floris
    Apr 23, 2013 at 4:46
  • i was not login i just select url as mentioned from the cache and i am not already logged in Apr 23, 2013 at 4:47
  • It's shows your account into your own pc only, when we click the above login link, it shows our User name.
    – Lucifer
    Apr 23, 2013 at 4:47
  • if i am already login then why it showing me login page Apr 23, 2013 at 4:48
  • yeah i got that problem yesterday i forgot to logout and today directly click the url as mentioned , but it should not show me the login page if i am already login Apr 23, 2013 at 4:52
  • 1
    where would you have liked to be redirected? - you asked for a specific page.
    – Floris
    Apr 23, 2013 at 4:56
  • You explicitly request the login page in your URL. Why wouldn't it comply? You might be wanting to switch to a different user.
    – Mat
    Apr 23, 2013 at 4:57
  • @Mat is it possible to switch to other user without logout current user ? Apr 23, 2013 at 5:11
  • I've never tried. Try it out if you want to find out.
    – Mat
    Apr 23, 2013 at 5:12
  • then it must specify there that do you want to swith to new user like that Apr 23, 2013 at 5:13
  • Look, I have no idea what you're complaining about here. You're asking a website for its login page. It's giving you that. If you don't want the login page, don't request it.
    – Mat
    Apr 23, 2013 at 5:17
  • @Mat i am not complaining i am just suggesting that if user already login then why it shows me login page and if its for switching user then it should shos me message like do you want to switch to other user? like that Apr 23, 2013 at 5:19

1 Answer 1


When you first logged in to Stack Overflow, a cookie was placed on your machine which remembers your login. Next time you go to any Stack Overflow related page, you will be recognized because of this cookie and show up as "logged in".

When you ask explicitly to be taken to the login page, that's where you are taken. The fact that you are already logged in doesn't matter. You might be wanting to change to a different user name.

Just to clarify some more: (disclaimer: I am deducing this from the described behavior, not because I have inside knowledge about the workings of the SO servers)

If you open a new browser session, but there is a cookie that shows you had been logged in previously and didn't log out, then you are considered "provisionally logged in". If you go to a particular question, you will be able to answer/edit/vote etc with the privileges of the last logged in person (usually, that's you). However, if you explicitly request the login page, you get taken there whether or not the cookie was set that indicated you had previously logged in and not out. This accounts for you arriving at a shared computer, and finding someone else had been using SO with a different user name.

Once you have established yourself as a logged in person, you are considered logged in for the duration of the session - that is, until you either log out explicitly, or close the browser. A logged in person doesn't need to be offered a login screen. Therefore, if you ask for the login screen you get redirected to the home page.

I hope this makes sense.

  • i got the way because yesterday i forgot to logout and today i select the mentioned url. but if i am already login then it make sense that should not show me login page. isn't it? Apr 23, 2013 at 4:54
  • 2
    If you had gone directly to the main Stack Overflow page, you would not see the login prompt. By using the URL you did ("please take me to the login page"), you were indicating you might want to log in as someone else...
    – Floris
    Apr 23, 2013 at 4:55
  • then it must specify that do you want to switch to switch new user like that? Apr 23, 2013 at 5:14
  • I think you are suggesting this would be an improvement. The reaction from everyone that is responding appears to be "this is what you expect. Log in as yourself (again, it won't stop you), as someone else, or just go to another page (since you are already logged in). The choice is yours."
    – Floris
    Apr 23, 2013 at 5:22
  • now i got it but before i just select url from the cache and shows me login page dont you think it should shows me some message like that Apr 23, 2013 at 5:25
  • now another strange if i am trying now to click on that url it redirect me to stackoverflow.com now why i cant see the login page though i am explicitly select Apr 23, 2013 at 5:32
  • It may have something to do with SESSIONS vs COOKIES. If you close your browser, the session is closed; and thus a request for the login page sends you to the login page - you "look like someone who might want to make a fresh start" (although you are considered logged in). Once you have an open session, it may be smart enough to say "hey - you are logged in. You didn't really mean to go to this page!"
    – Floris
    Apr 23, 2013 at 5:39
  • as you have told that already logged in doesn't matter then why i cant redirect there after login Apr 23, 2013 at 5:41
  • You can, once you log out or close the browser and re-open it. It makes sense - just not to you...
    – Floris
    Apr 23, 2013 at 5:45
  • i think you are not getting my question because i didnt write it well Apr 23, 2013 at 5:49
  • I have updated my answer - I think I understand your question.
    – Floris
    Apr 23, 2013 at 5:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .