Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

Re^2: Concern with CGI::Session

by rjsaulakh (Beadle)
on Jun 14, 2005 at 12:43 UTC ( #466511=note: print w/ replies, xml ) Need Help??

in reply to Re: Concern with CGI::Session
in thread Concern with CGI::Session

i have some queries
i have set session id and domain name in the cookies which are sent to the user browser

$cookie =$cgi->cookie( -CGISESSID => $session->id, -expires => '+1h', -domain => 'B2R6A056a' }; print $cgi->header(-cookie=>$cookie);
now when the user clicks a tab and goes to another page i want to fetch the cookie from the usersession and then intially trying to print all the values got from the cookie
my %cookie = fetch CGI::Cookie; foreach $keys ( sort keys %cookie) { print "$keys : $cookies{$_}"; }
but i am not able to fetch the cookie
is there some problem in the line of my thinking
or is there something more i have to take care of
please advice

Comment on Re^2: Concern with CGI::Session
Select or Download Code
Re^3: Concern with CGI::Session
by cees (Curate) on Jun 14, 2005 at 14:10 UTC

    The -domain part of a cookie should be the domain name of the server(s) that you want to receive the cookie (1). 'B2R6A056a' does not look like a valid domain name to me, and that is probably causing your problem.

    My suggestion would be to simplify things by removing the -expires and -domain part of the cookie, and seeing if that works. If it does work, then add one of the options back in ans see if things still work. Simplifying things and taking it one step at a time is a very successful debugging tool that is useful when you are not sure what is causing your problems.

    If that doesn't work, then you need to start looking carefully at the actual headers being sent along with the request (that includes client headers and server headers). Mozilla can be helpful with this, since it has plugins to debug client and server HTTP headers. Look for the Set-Cookie: header in the server headers, and Cookie: header in the client headers.


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://466511]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (12)
As of 2014-10-01 13:32 GMT
Find Nodes?
    Voting Booth?

    What is your favourite meta-syntactic variable name?

    Results (21 votes), past polls