session timeout

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
User avatar
gurjit
Forum Contributor
Posts: 314
Joined: Thu May 15, 2003 11:53 am
Location: UK

session timeout

Post by gurjit »

hi all,

i'm looking for a script or method of how i can change the session timeout in the code. at the moment the session times out every 30 minutes via the server setting. how can i override this and set the session to timeout after 20 minutes. i want to code this into my template rather than set it in the php.ini file.
User avatar
markl999
DevNet Resident
Posts: 1972
Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)

Post by markl999 »

User avatar
Joe
Forum Regular
Posts: 939
Joined: Sun Feb 29, 2004 1:26 pm
Location: UK - Glasgow

Post by Joe »

Im not too sure if theres a way to participate this with code. instead I think you would have to edit the php.ini file. Im not to sure on this so please don't take what I said to truth.

Best of luck


The lil man Joe 8)
hedge
Forum Contributor
Posts: 234
Joined: Fri Aug 30, 2002 10:19 am
Location: Calgary, AB, Canada

Post by hedge »

Just store a datestamp as a session var, update it each time you hit a script and check it against current time to see if the last hit was too long ago.

although this still won't let it last past the time set in your php.ini file.
User avatar
Joe
Forum Regular
Posts: 939
Joined: Sun Feb 29, 2004 1:26 pm
Location: UK - Glasgow

Post by Joe »

Now theres an idea that I never thought of. :(
Guilherme Blanco
Forum Newbie
Posts: 12
Joined: Wed Jun 02, 2004 4:58 pm
Location: São Carlos - SP/Brazil
Contact:

Post by Guilherme Blanco »

During the last 2 weeks, I've been creating a session/cookie manager...

You can set custom timeouts to each session.

If you insterested... just hit me.

Regards,
Post Reply