Session life span

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Locked
AJB
Forum Newbie
Posts: 1
Joined: Thu Jun 06, 2002 12:50 pm

Session life span

Post by AJB »

Hi,
This has been asked before by another but I didn't quite get the answer.

I'm OK creating a session, adding variables.
I'm OK accessing those variables on another page.
I'm OK on removing variables & destroying the session when they get to the last page in the sequence.

Buuut....

What happens when the user clicks "Back," or closes the window half way down the set of pages in the sequence, or clicks "New window" where the browser starts at the same place? Do you end up with un-cleared up sessions littering your server's drive? Do they "expire"? Any advice much appreciated.

Cheers
Tony
User avatar
J_Iceman05
Forum Commoner
Posts: 72
Joined: Wed Aug 03, 2005 10:52 am
Location: Las Vegas, NV

Post by J_Iceman05 »

when the user presses back, it doesn't reacreate new variables.
if you create a new variable on that page, then it will reassign the variable as if you created it.
if they close the window half way through the sequence the session is gone. those variables have a life span no more than the browser... close the browser = delete variables.
as for opening a new window, im not real sure what happens there, i assume that doing so does create new variables using the same info existing in your current session variables.
doing something in that new window may also edit what those variables are in the current window.
hope this helps, and i'm sure others who know more can fill in the blanks from here...
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

stop necrothreading.
Locked