Session problem

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

Post Reply
marshall
Forum Newbie
Posts: 3
Joined: Mon Jul 31, 2006 9:26 am

Session problem

Post by marshall »

Well, it's very simple..

I have a session with a expiring time...

When session expire, I would like to redirect the site...

Which variable should I set or which function should I use ?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

There is no one function or variable for this. The most simple way I can think of is where you store the expiration time in the session or as part of the session data in some fashion, but do not actually set the session to expire then as far as the user is concerned. Checking the current time against the time stored to use the redirection logic.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Re: Session problem

Post by RobertGonzalez »

marshall wrote:Well, it's very simple..

I have a session with a expiring time...

When session expire, I would like to redirect the site...

Which variable should I set or which function should I use ?
Are you talking about redirecting at the exact time the session expires? If that is the case, you will need to combine Feyd's suggestion with some Javascript to get the client side process you want.
marshall
Forum Newbie
Posts: 3
Joined: Mon Jul 31, 2006 9:26 am

Post by marshall »

Actually, the problem is:

I have a page passing the variable via GET method. When the session expires, the variable still there in the URL making a new login impossible...

Got it ?
Post Reply