Hello all. I'm using CGI Session for a project and had a question about managing cookies. When someone connects to the site should I look for a cookie within each page. And if it doesn't exist then send them to the login page? (Yes I have a member's only section but not all parts are members only). Which leads to my next question. If this is true, then should I pass the session_id in a hidden field to every page I will be calling (displaying) so that I can pull there info from their profile. And if it's not there then 1) create a new session for a non-member page or 2)make them login and then create a new session and set it to logged in.(I'm basically just trying to figure out the algorithm I should use for when someone accesses members vs non members parts of the page and when to start the session or check for the session when someone intially accessing any part of my site directly. I've been using cgi-session Cookbook as my guide.) Thanks

In reply to Cookie Management by shaolindoman

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.