SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict scoobasteve1982's Avatar
    Join Date
    Apr 2007
    Posts
    333
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to keep session alive until users clicks log out

    Hi there,

    How should I go about keeping a session alive until a user clicks log out? I'm not using coookies. I'm using session variables. I would like the session not allow the user back in after a few hours of no activity...thanks a million!

  2. #2
    SitePoint Evangelist hexburner's Avatar
    Join Date
    Jan 2007
    Location
    Belgium
    Posts
    591
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you're on a shared hosting, you'll have to write your own session handler. It's easier and safer to store the sessions in a database instead of in the filesystem.
    When you write your Garbage Collection you can easily use hours, days, even years to keep the session alive as long as the user doesn't log out, closes his browser or exceeds the maximum lifetime you choose.
    FOR SALE: 1 set of morals, never used, will sell cheap


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •