In my current project I have written a state module that takes a hash of info, Data::Dumper's it, Crypt::TripleDES encrypts it and then mime encodes it. It also does the reverse to get the data structure back.

I then pass this back to my main app for dealing how I want. Currently I am storing an ID and a timeout. I use the ID in the program to fetch more info - much like the branding that Merlyn was talking about further up this node.

I am using the timeout as a means of providing an inactivity flag. I haven't finished implementing this yet but the idea is to allow someone to be deactivated if they walk away from their browser. I didn't want to rely on cookie timeouts as this then ties me to a single session solution.

Slightly OT but the EU almost banned cookies over here. Obviously this was never going to happen but beurocrats love to meddle :).

The kind of interface I am using for my session object is as follows:

addToSession() getFromSession() _buildSession() clearSession session() toString() <------- called via overload key() <------- for the encryption (obviously :P)


I didn't use anything like Apache::Session simply because I had to ensure it would work with IPlanet, Apache and IIS for the content management system I'm building at work.

Hope that helps.

In reply to Re: Polling All Monks: Favorite Ways To Maintain State by simon.proctor
in thread Polling All Monks: Favorite Ways To Maintain State by jerrygarciuh

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.