The "fastest" way to store session data is just within your Apache process.

But usually, you are running more than one Apache process (unless you run the MPM threads model only). So you will want to share the session data among processes because you never know which process will handle the next request of the user. So you maybe want to use some shared memory that Apache also provides, like APR::Table.

But that information gets lost if you have more than one machine and don't want the headache of pinning a source IP address to a server. Then maybe you want to persist the session data to some other shared medium, like a Redis server, or a database, or just as a JSON file to a shared disk.

There are many options and not all of them are equally suitable to all situations. This is why there are modules like CGI::Session that implement various methods of storing sessions.

If you are Google-scale, you maybe want to keep the session stored on the users machine and just verify that the session is still as you sent it to the user by using cryptographically signed session cookies. This is what JWT is all about.

Usually, if you are going the route of using a database table as session store, you will have to create that table yourself.


In reply to Re: Looking for general pointers on Apache::Session by Corion
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.