Page 1 of 1
Session Variables Being Re-initialized!!
Posted: Mon Dec 18, 2006 5:23 am
by montecristo
Hi guys,
I have a php application with a oracle database backend. The application requires the user to login using a username and password, which are used to query the database.
These are stored in session variables, which work fine. BUT If I open another internet explorer window and then go back to my appplication, the session variables have been re-initialized.
Is there any way to stop this from happening?
Thanks in advance
Posted: Mon Dec 18, 2006 6:45 am
by Chris Corbyn
I'm not sure what you mean. Sessions are persistent. If you open a window and log into the app, then open a second window and go to the same application you'll be sharing a session. That's normal behaviour.
Is that what you mean?
If that's not what you mean then perhaps post some code

Posted: Mon Dec 18, 2006 8:15 am
by montecristo
Thanks for getting back to me.
I log into my application and it works fine. I then open another window with php developers network.
I then go back to my application and the session variables have been reinitialized.
I don't understand why this happens, perhaps I should put a time limit on the session?
Thanks
Posted: Mon Dec 18, 2006 8:29 am
by iknownothing
Have you in any way changed the original page from when you left it? If you are changing your page apon returning to it then perhaps that second page is not communicating with the first, or you are destroying the session before you end up at the second page.
There is no way that it can re-initialise unless you have a Loop (check your code, incase you are infact looping the session info)
Posted: Mon Dec 18, 2006 10:07 am
by volka
The internet explorer "stores" cookies with an expire value of 0 (session cookies) only in memory and does not share them with other IE processes. I.e. if you start another IE process it has no access to the other process' session cookie data.
Posted: Mon Dec 18, 2006 10:14 am
by montecristo
Thanks for the feed back
The session variables were being re-initialised by poor code
When I was going back to the page , the session variables were being re-assigned by a $_POST (i,e the post never took place)
Thanks for your time