Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??


Thanks for responding.

Firstly note that I broke the code down, excluding un-related parts. I am actually sending the headers only once. Once I have printed the redirect header, I exit the script (exit(1)). Its doing everything fine, its just not registering that i'm logged in, if I visit the page in a particular way (i.e. from the homepage after logging in, or from a redirect index page).

I have used CGI:Session on many occassions, but never for such a task. I have read the tutorial, as well as the main documentation a few times. From what I gathered, you don't need to pass an SID, unless the user has i.e. cookies disabled. The module should handle everything automatically.

Quote from the tutorial based on this line of code "$session = CGI::Session->new () or die CGI::Session->errstr;":

"We didn't check for any session cookies above, did we? No, we didn't, but CGI::Session did. It looked for a cookie called CGISESSID, and if it found it tried to load existing session from server side storage (file in our case). If cookie didn't exist it looked for a QUERY_STRING parameter called CGISESSID. If all the attempts to recover session ID failed, it created a new session."

I have tried CGI's redirect() method, and also used a basic HTML meta refresh, which results in the same issue.

I'm not used the the style of code you have provided, i'll have to examine it more closely to see if theres anything you've shown that could fix my issue.


In reply to Re^2: CGI::Session "cache" issue by Zhris
in thread CGI::Session "cache" issue by Zhris

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, 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, 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.
  • Log In?

    What's my password?
    Create A New User
    and all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others lurking in the Monastery: (7)
    As of 2018-06-20 15:53 GMT
    Find Nodes?
      Voting Booth?
      Should cpanminus be part of the standard Perl release?

      Results (116 votes). Check out past polls.