SESSION lifetime

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
How long does a session exist? Is there a setting in php that
determines when a session file is removed?

The reason I ask is on a page of my site I have a flash text editor
that communicates with the server and the posibility exists that
person may not save the changes they are making to the server for
hours or more as they work in the editor, and if the session is
expired inthat time it would cause anything they did to be lost.

Bill H

Re: SESSION lifetime

Hash: SHA1

Bill H wrote:
Quoted text here. Click to load it

there you go:
Version: GnuPG v2.0.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla -


Re: SESSION lifetime

Bill H wrote:
Quoted text here. Click to load it

Yes. Or rather that a session expires. RTFM.

Quoted text here. Click to load it

You must be kidding. Session expiration is the least of your problems. What
if the persons power goes off?

If your user is doing any sort of serious editing then said user must save
to somewhere non-volotile every minute or so. No bloody hours.

Your desitn is flawed.

Re: SESSION lifetime

Quoted text here. Click to load it

So the answer is easy: do not store it in the session then. This will
probably involve creating user logins if they do not exist yet. Make
your web site behave ("feel") like a PDA. You can switch off a PDA at
any time and applications are supposed to store all data to be able to
come back at the very same point as if nothing happened. This is
perfectly possible with web applications also, but you will have to have
some sort of login on the site to know which set of work data to
restore. So store the text in a database and keep only the necessary
data in the session (like the user Id after login).

If you did not work with logins and sessions yet, do a net search on
"session highjacking" and read the PHP manual about the
session_regenerate_id() function and the security section of the session
functions page.

Good luck.

Re: SESSION lifetime

Quoted text here. Click to load it

Include a hidden iframe with a timed refresh to keep the session


Site Timeline