By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,326 Members | 2,726 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,326 IT Pros & Developers. It's quick & easy.

Session timeout

P: n/a
I use session ID which is stored in a MySQL database and when the user click
on the Logout button, the following is done
$db = new DB();
$result = new DB_query($db, "delete from $db_session where session_id =
'$sessionID'");

// Unset all of the session variables.
session_unset();
// Finally, destroy the session.
session_destroy();

The webserver is Apache 1.3.31 (Unix) on Linux (Kernel version
2.4.21-20.ELsmp) and PHP is version 4.3.9. I am wondering is there a way of
setting a "session timeout limit", so user would be forced to logon if they
leave their web-browser inactive for, say, 15minutes? Or would I have to
resort to adding a datecolumn to the session table in MySQL and compare the
time everytime a page is loaded?
Jul 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
"peter" <pe***@mail.co.uk> wrote in news:cl*********@enews2.newsguy.com:
The webserver is Apache 1.3.31 (Unix) on Linux (Kernel version
2.4.21-20.ELsmp) and PHP is version 4.3.9. I am wondering is there a
way of setting a "session timeout limit", so user would be forced to
logon if they leave their web-browser inactive for, say, 15minutes?
Or would I have to resort to adding a datecolumn to the session table
in MySQL and compare the time everytime a page is loaded?


Im not an expert, and Ive never done this, but I think you can set the
session time out in the config file, or set it for your site if you do not
have access to it. But the session itself would have to be in a file not
mysql... if thats what you are doing.

Perhaps someone with much more knowhow than I can elaborate on this.
Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.