SitePoint Sponsor

User Tag List

Results 1 to 7 of 7

Thread: sessions file

  1. #1
    SitePoint Member
    Join Date
    Feb 2003
    Location
    Laguna Niguel, Ca
    Posts
    24
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    sessions file

    OK the session ID is placed on the clients computer and that ID points to a file on the server. How long does the file on the server stay. What deletes it? I am guessing they must go away somehow.

    Dennis

  2. #2
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    With no other interferance, the file would proberly stay on the server indefinitely ? Or are you talking about the session it's self... In which case the session would die on the browser closure or leaving the site in question, unless you store the ID in a cookie... ?

  3. #3
    SitePoint Member
    Join Date
    Feb 2003
    Location
    Laguna Niguel, Ca
    Posts
    24
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes I mean the file on the server. But that makes no since to have the session file on the server stay there for ever as we have thousands a day. Are you sure?

  4. #4
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I would have to think so unless you delete the file ? The session ID is proberly unique... thus the file is also unique I'd like to think - based on the ID somehow ? Why not store a cookie on your clients computer and check this before you re-create a new file ? If the file based on the ID from the cookie exists, delete it ? An other way you can do it is to delete any/all files based on the timestamp exceeding x amount of days... Cron would help you to automate this...

  5. #5
    ********* wombat firepages's Avatar
    Join Date
    Jul 2000
    Location
    Perth Australia
    Posts
    1,717
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP routinely , automatically does garbge collection on session files on the server , & unless you extend the session cookie lifetime the session cookie on your computer dies the moment you close your browser (all of them that is)

    you can extend the lifetime of the session cookie and also the life of the session file on the server but that would just make session hijacking a whole lot easier.

  6. #6
    Free your mind Toly's Avatar
    Join Date
    Sep 2001
    Location
    Panama
    Posts
    2,181
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It is also worth mentioning that you can have full control over your sessions by storing them on your database rather than your server.
    Community Guidelines | Community FAQ

    "He that is kind is free, though he is a slave;
    he that is evil is a slave, though he be a king." - St. Augustine

  7. #7
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Look at this link on the PHP Advanced Forums... Could prove to be useful I think.

    http://www.sitepointforums.com/showt...ession+handler



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
  •