1) What's the fastest way to store session data? In the DB? In a file? What are the advantages/disadvantages of the different methods?

Generally (you know this), RAM is faster than disk ...

The only way to know for sure is to benchmark

Most people don't base their decision on speed alone

2) If I use a DB, do I have to set up the DB table for storing session data ahead of time or prep the DB in any way?

Of course, it depends, see Apache::Session::Store::MySQL for details (or ::Oracle or ... )

3) There is a module called Apache::SessionManager. Not sure if that is the direction to take or not. It looks like it might do the same thing as Apache::Session but is built specifically for mod_perl. Is that right?

Ignore that its old , less generic, hasn't been updated since 2004...

Any other useful guidance or general pointers is appreciated. Thank you very much for your time.

Remember to remind yourself Apache::Session is generic and not apache specific, you can use it from Dancer or Mojolicious or Catalyst or ...

However, it is old, the fallback random id generator isn't as good/modern/best practice as what the frameworks use

When one of the mojo(?) users discovered a better/proper sessionid/rand generator, he updated the Dancer and Catalyst guys on the issue -- there is a lot of overlap between the mojo/dancer/catalyst guys -- they don't keep up with Apache::Session -- i dont think anybody does -- the CGI::Session guys do seem to keep up ...

However

If you're aware of these things, and you like to learn, go for it, the frameworks aren't that different from "best" practices (cgi101)

All the frameworks give you a request object

All the frameworks want you to give them a response object

If you're using CGI.pm and following CGI to mod_perl Porting. mod_perl Coding guidelines you're 98% modern , only 2% away from using any "modern frameworks" which have a response object

cgi101


In reply to Re: Looking for general pointers on Apache::Session by Anonymous Monk
in thread Looking for general pointers on Apache::Session by nysus

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.