Siddartha has asked for the wisdom of the Perl Monks concerning the following question:
My script worked perfectly until we did some maintenance on the servers and upgraded the firewall. Now suddenly my script doesn't want to create cookies anymore. My script haven't changed and the apache config looks the same.
I have no idea where to start looking for problems.
Here is a snippet of code:
$query = new CGI; # $menu and $name is passed to this script # $menu is not defined when the script is called the first time if (!(defined($menu))) { if (!(defined($name))) { print $query->redirect('http://blahblah.com/cgi-bin/pdf_lo +gin.cgi'); }; my $cookie_name = $query->cookie("name"); if ($cookie_name ne $name) { my $cookie = $query->cookie (-name => 'name', -value => $name, -domain => 'blahblah.com', -expires => '+10y'); my $myurl = 'http://blahblah.com/cgi-bin/login.cgi?name='.$nam +e; #This redirects to the same script print $query->redirect (-cookie => $cookie, -uri => $myurl); exit 0; }; } else { my $cookie_name = $query->cookie("name"); $name = $cookie_name; };
The script relies on the cookie being set, if not it calls the same URL and sets the cookie. What seems to happen is that it is calling the same script over and over and never sets the cookie. I am sure that the browser I am testing it on accepts cookies.
Any ideas would be appreciated, I have no idea where to start. I took out the checking part and everything works perfectly.
--Siddartha
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: The cookie crumbles
by Masem (Monsignor) on Oct 24, 2001 at 15:03 UTC | |
by Siddartha (Curate) on Oct 24, 2001 at 15:24 UTC | |
by Masem (Monsignor) on Oct 24, 2001 at 15:42 UTC | |
by Siddartha (Curate) on Oct 24, 2001 at 16:08 UTC | |
|
Re: The cookie crumbles
by joealba (Hermit) on Oct 24, 2001 at 16:29 UTC | |
by Siddartha (Curate) on Oct 24, 2001 at 17:18 UTC |