Powerman's post is very big and maybe a little unlear. So I try to formulate why we begin to use this sessions and advantages of it (and a bit about realization):

Several start points :

1) Session should work lazy way. Is it possible - magically both for programmer and designer.

2) Should allow work to an user in several windows with different session id (e.g. Admin open several wraped Member's control centers).

Why not to use cookie ?

Main reason - many users disabled in IE cookie. Even session ones

And several minor reasons - for example, this will be impossible (ok. possible, but VERY UGLY and difficult) open several different sessions in one browser simul.

So we choose to store session in PATH. in form like www.host.com/session_id/some_path/my.cgi

This allow to save session_id between user requests in user URL and allow to magically save session_id in relative hyperlinks. (e.g. link like href="../other_path/own.cgi")

Ok. Next question - how to deal with this at Apache side ?

Straitforward solutuion - use mod_rewrite. Unfortunately soem web hostings don't allow to use mod_rewrite.

Next solution looks like very elegant. And we don't meet it before. I mean use symlinks as it describe Powerman. (for example our directory is /www/somehost.com/htdocs/. so /www.somehost.com/htdocs/-/12/34/56/78/90/-/ will lead to /www/somehost.com/htdocs/ again.)

Thats all about the idea. Now several words about realization :

We store users data in Session table (MySQL). in .cgi

%S = load_session();

calls made.

This call

1) read session info from $ENV{REQUEST_URI}

2) execute new_session() if needed

3) return Session data as hash.


In reply to Re: Tired of session/cookie problem by asdfgroup
in thread Tired of session/cookie problem by powerman

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.