in reply to Age of CGI sessions?

Assuming you're using CGI::Session, use the expire method. Straight from the doc:
# expire the session itself after 1 idle hour $session->expire('+1h');

Update Made 'doc' a link to the relevant section of the documentation

Replies are listed 'Best First'.
Re:Re: Age of CGI sessions?
by howdy (Initiate) on Jun 05, 2003 at 23:31 UTC
    Sorry I didn't include enough detail in my first post. I'm using CGI::Session and I have my sessions expire set at 30 minutes:

    $session->expire('+30m')

    My problem is that my MySQL database keeps filling up with sessions that I want to delete after they are expired. I was thinking about parsing the epoc out of the a_session field, but I am looking for a more elegant way to clean the expired sessions out of the database.

    Thanks
      I see. I haven't used CGI::Session before, but perhaps you could use a combination of $session->atime, $session->expire, localtime, and $session->delete to get something like this pseudo-code:
      $session->delete if (($session->atime + $session->expire) < localtime) +;