Session timeout

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • peter

    Session timeout

    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?


  • Theo

    #2
    Re: Session timeout

    "peter" <peter@mail.co. uk> wrote in news:clciok01nj q@enews2.newsgu y.com:
    [color=blue]
    > 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?[/color]

    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.

    Comment

    Working...