SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Feb 2001
    Location
    Canada
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    how does one automatically delete sessions form the "temp" directory
    ( refering to session.save_path in php.ini)

    what I have in my logout.php is something like this

    session_unregister("theSession");
    session_destory();

    ... what am doing wrong? do need to make nightly script to do a cleanup?

    Thank you in advance

  2. #2
    SitePoint Author Kevin Yank's Avatar
    Join Date
    Apr 2000
    Location
    Melbourne, Australia
    Posts
    2,571
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    PHP should clean up that directory automatically by randomly scanning for and deleting expired sessions. There is a setting in php.ini that lets you specify the likelihood that any given page request will also result in expired session files being purged. Setting it to the maximum value will cause this to happen on every request, but this might have an adverse effect on your server's performance...
    Kevin Yank
    CTO, sitepoint.com
    I wrote: Simply JavaScript | BYO PHP/MySQL | Tech Times | Editize
    Baby’s got back—a hard back, that is: The Ultimate CSS Reference


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
  •