Hey there monks.

I've recently decided to see what was available for handling sessions in Perl. I've done sessions in Java, which is rather simple (being built into Servlets and all), and I've done my own in Perl with CGI apps before.

So, using mod_perl, what are people's opinions about the best method for handling sessions? Apache::Session seems to be what all the books and websites talk about, but I had many problems that others seem to have (but found no final answer). I find that data I put into my tied hash don't seem to stick. But on occasion it does.

I thought this might be due to my using PostgreSQL for the Store. So I tried the File store. I had similar behavior. My only thought is that it's something related to MacOS X's perl implementation (5.6.0). Hopefully that will be updated soon. I found people with the same questions over the years in archived discussion forums. But few answers.

So, I tried CGI::Session. Although not accurately documented, it does work with PostgreSQL and other stuff. I don't know how "safe" it is for mod_perl though. Also, CGI::Session seems more recently maintained, as opposed to the 2001 last update for Apache::Session. Also, CGI::Session seems to have nice support for automatic expiration, etc.

What are your experiences with Sessions and mod_perl? Anyone know what some of the best options are for this?

Looking forward to yer thoughts...
-Alex


In reply to Apache::Session vs. CGI::Session by Anonymous Monk

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.