i've just been initiated into the wonderful world of maintaining state and sessioning with the Apache::Session module. Works great, though there is a steep learning curve on the more practical aspects of sessioning.

My question relates to the most practical way to keep multiple sessions open at one time, such as when the user may have multiple browser windows open performing simultaneous queries and the like. The nature of the web site is that a user makes an initial query, but then can subquery the results of a previous query to refine their results.

I am using a single session cookie to pass around a session id between scripts, however each invocation of a script with the same session id 'pollutes'/invalidates other currently open sessions. i am hesitant to take the approach of just storing every CGI request parameter in the one session hash, working out what query extends what query, and then artificially constructing the complete query from a 'cgi-parameter history'.

i'm sure this could be done much better -- maybe by using a new session id for every request and keeping a reference to the 'parent' session for each request? how else does one spin off multiple derivative sessions without disturbing other existing/past sessions? wisened monks please advise...

thanks, matt


In reply to practical aspects of sessions and state by d_i_r_t_y

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.