Basically my idea was to maintain state using 2 things. On the server side i have an object, with appropiate data stored in it and functions and so forth, and a database. On the client side i have a unique 'session id', possibly a md-5 checksum or something highly random of that nature. When i first get a request, i would generate my object, generate a md-5 sum, some how store the md-5 sum client side, possibly via cookie, or maybe hidden input fields, or something of that nature, then use the
Storable's freeze() method to store the object in my database, using the md-5 sum as the key. Then on subsequent requests, i can quickly do a select from the database, and use the thaw() method to restore my object, then go on using the object for my purposes.
Now, my questions.
- Does anyone see any major flaw in this?
- How could i get Storable to read from a database, as opposed to a file
- And does anyone know how i could get Storable working on my win32 box, seeing as all i could find is the source, and i have not had much luck getting the .xs parts of the module to compile?
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.