Ugh..  OK, step by stepping it.  I've got the forwarding working, however, now
my script has stopped reading the cookies.  Not only can I not ready MY 
cookie,
but I can't ready ANY cookie.
This function was working perfectly fine.  I didn't touch it at all 
while IO was
testing the writing of the cookie.  But now that the cookie can be written
correctly in all browsers it will not read at all.
I have even tried printing out ALL the cookies.  It prints nothing.
poop.
Here's what I've got:
----------------------------------------------
my %cookies = fetch CGI::Cookie;
my $userInfo = $cookies{"$COOKIENAME"}->value;
----------------------------------------------
I get an error on the second line of that code:
"Can't call method "value" on an undefined value at functions.pl line 45."

My brain is melting.
any help would be much appreciated.
Thanks.
--Alex


Quoting Alex Brelsfoard <[EMAIL PROTECTED]>:

> OK, So I mangled things around and now I can get the cookie written
> using CGI.PM
> It looks something like this:
> ----------------------------------------
> my $q = new CGI;
> my $cookie = $q->cookie( -name    => $COOKIENAME,
>                           -value   => $cookieContent,
>                           -domain  => "www.wpi.edu",
>                           -expires => "+1h",
>                           -path    => "/cgi-bin/Regi",
>                           -secure  => 1 );
> print $q->header(-cookie=>$cookie);
> ----------------------------------------
> But this has introduced a new problem.
> The very next thing I am doing in my script is forwarding the user to a
> different script, just with a simple print "Location: ...\n\n" command.
> But now that the header has been printed with CGI, this does not work.
> Is there
> any way for me to forward the user on to another page at this point?
> Any advice?
>
> Thanks again.
> --Alex
> Quoting [EMAIL PROTECTED]:
>> Quoting Philipp Hanes <[EMAIL PROTECTED]>:
>>
>>>
>>>> Here is the code I started with and have reverted back to:
>>>> ----------------------------------------------
>>>> my $cookie = "Set-Cookie: " .
>>>>    "$COOKIENAME=$cookieContent; " .
>>>>    "Host=www.wpi.edu; " .
>>>>    "expires=+1h\n";
>>>> print $cookie;
>>>> ----------------------------------------------
>>>
>>> One thing I notice is that the RFC mentions "Domain" and not "Host"
>>>
>>> http://www.faqs.org/rfcs/rfc2965.html
>>>
>>> Also, "Version" is required, according to that document.
>>>
>>> It's been a long time since I built cookies by hand, but perhaps the cookie
>>> is being rejected because it does not conform?
>>>
>>>
>>
>>
>>
>>
>> _______________________________________________
>> Boston-pm mailing list
>> [email protected]
>> http://mail.pm.org/mailman/listinfo/boston-pm
>>
>
>
>
>
> _______________________________________________
> Boston-pm mailing list
> [email protected]
> http://mail.pm.org/mailman/listinfo/boston-pm
>



 
_______________________________________________
Boston-pm mailing list
[email protected]
http://mail.pm.org/mailman/listinfo/boston-pm

Reply via email to