perleager:

I was reading the CGI::Session manual (like a good little developer does :-)) and I noticed that you are using the DEPRECATED method 'close()' (the horror!!)

Currently you call 'load()' (passing in the ID) and then call 'is_expired()', and then, if it's expired, call delete(). My thought is that CGI::Session, when it calls the 'load()' it may very well call the 'is_expired()' off the hop. Are you 100% sure that after load()ing an 'expired session' that CGI::Session isn't doing data store cleanup? (ie. already removing it)

IMO - I think you should write your own 'is_expired()' sub that inspects a Session.ID using DBI, which returns true/false. Write another sub that takes a Session.ID and deletes it's using DBI (e.g execute SP or DELETE statement.) Once you've got those pieces done, your CRON job loops front to back on the Session table, passing each ID to the 'is_expired()' sub, calling the delete when true. Conceptually what you have already but avoid the load()ing of the already expired session.

Maybe I'll just have to write some code to show you what I mean.... if you're even still reading this thread. ;-)

Kurt


In reply to Re: CGI::Session disconnect invalidates 1 active statement handle by whereiskurt
in thread CGI::Session disconnect invalidates 1 active statement handle by perleager

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.