Results 1 to 4 of 4

Thread: Removing session data from server

  1. #1
    Join Date
    Apr 2012
    Location
    Central New Jersey
    Posts
    304
    Thanks
    106
    Thanked 3 Times in 3 Posts

    Default Removing session data from server

    Folks,

    How can I remove session data from the server after x number of seconds of inactivity? I assume the solution would use the session_gc() function.

    A.
    Last edited by marain; 09-30-2022 at 01:44 PM. Reason: Reword question to remove the word "script".

  2. #2
    Join Date
    Oct 2022
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    The session destroy() function can be used to end a PHP session. This function doesn't need any arguments, and all the session variables can be deleted with a single call. If you only want to get rid of a single session variable, you can use the unset() function.

  3. #3
    Join Date
    Apr 2012
    Location
    Central New Jersey
    Posts
    304
    Thanks
    106
    Thanked 3 Times in 3 Posts

    Default

    Thank you, but neither unset() nor destroy() satisfy my needs. I want session data to not disappear immediately but, rather, upon passage of a defined period of inactivity. I suspect a gc (garbage collection) function is needed.
    Last edited by marain; 10-03-2022 at 06:17 PM. Reason: Clarify response

  4. #4
    Join Date
    Oct 2022
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by marain View Post
    Thank you, but neither unset() nor destroy() satisfy my needs. I want session data to not disappear immediately but, rather, upon passage of a defined period of inactivity. I suspect a gc (garbage collection) function is needed.
    Ok I got Your pont

Similar Threads

  1. Resolved session in iFrame loses session data
    By crobinson42 in forum PHP
    Replies: 4
    Last Post: 02-29-2012, 12:59 AM
  2. Replies: 0
    Last Post: 05-27-2008, 04:34 AM
  3. Getting data from Unix server
    By contracer11 in forum Looking for such a script or service
    Replies: 2
    Last Post: 05-13-2008, 10:28 AM
  4. Replies: 3
    Last Post: 09-08-2006, 05:24 PM

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
  •