Setting an expire time says when a session should expire.   However, it is only on the next attempted use of that same session id that new()/_init()/_init_old_session() look up the old session and decide whether to call delete()/flush() to really kill the file.   That much I can read from the code.   So perhaps my first sentence should read "Setting an expire time says when a session should become expired."   (note passive voice)

I've traced through the module interactions with the Perl debugger on my system because I was seeing perhaps what you are seeing, that the session files are not being deleted.   They _do_ get deleted if referenced again.   (This on RH 7.2 w/ CGI::Session 3.95)   I still have lots of files leftover because some of my transactions are abandoned and the session id's are never referenced again.

So, apart from abandoned transactions, are you sure you're setting the session id so that the next screen finds and references it?   In my program I accomplish this by using the $session->header() routine to set a cookie.   What are you using to get the session id back?


In reply to Re: delete session using CGI::Session by shenme
in thread delete session using CGI::Session by tbone

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.