in reply to Re^3: CGI::Session "cache" issue
in thread CGI::Session "cache" issue
Hello,
I have followed your advice, and I seem to have got it to work as I expect. This has though confused me entirely. How was it possible that I was even able to login, if I hadn't set the cookie on redirect. And why should it have made any difference whether I called Members.pl directly (displays logged in), compared to calling a php webpage that redirects to Members.pl (displays not logged in). Considering this, I believe my "confused" understanding was justified, unless there is some logical explanation. Just to clarify, I wasn't sure what aspect of my code may have caused the problem, therefore I wanted to provide everything that revolved around CGI::Session.
Here are the important snippets of my updated "login" code:
#create session my $session = new CGI::Session(); #create cookie my $session_cookie = new CGI::Cookie( -name => 'CGISESSID', -value => $session->id(), -domain => 'domain.com', ); #redirect print redirect( -cookie => [$session_cookie], -uri => $referer, );
Thanks for your advice and persistance,
Chris
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: CGI::Session "cache" issue
by Anonymous Monk on May 23, 2011 at 23:29 UTC | |
by Zhris (Initiate) on May 24, 2011 at 18:30 UTC |