It does seem to me as if there is a delay sometimes between the data being written to the session vars, and reading them back.
The actual code I am testing isn't really to do with logins, but to detect if cookies are deleted or disabled. It also works fine apart from, this delay that sometimes makes it fail.
I don't think its a browser cache issue, I have various headers set so it dosen't cache any of the pages, and the time does update...
It's a bit strange really. If i unset the session, then set the session variable(in logout), then redirect to the login page, it will work... but this defeats the purpose.