<agree monk="AgentM" />

I assume you are familiar with the downside of not using cookies; without a required login by the client you cannot maintain state beyond the current connection. Of course, if you require a login (e.g. "To resume your previous shopping session, please log in!" link), you can get around this.

Managing state is not so bad without cookies, you don't need to store all the cart data on the form in a <input type=hidden> field, but you do have to store a local sessionID in either a <input type=hidden> field or pass it in the query string. Either way, CGI.pm makes it easy to grab that info back from the client.

In order to use the sessionID, I would recommend the DB route, although you can do it using a simple text file on your server. Going the DB route, create a SQL table like this one (of course yours will be different, but this is just an example ;) :

use shopdb; create table sessions ( SessionID int, isComplete bool, SessionData varchar[2000] );

...and then you just post to the DB just like you would have been doing to the cookie.


In reply to Re: Saving State w/o Cookies by Shayk
in thread Saving State w/o Cookies by motomuse

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.