Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

setting cookie without using $cgi->header(-cookie=>$cookie);

Status
Not open for further replies.

spewn

Programmer
May 7, 2001
1,034
i'm using this:

Code:
$cgi = new CGI;
$sid = $cgi->cookie("CGISESSID") || undef;
$session = new CGI::Session(undef, $sid, {Directory=>'/tmp'});
$cookie = $cgi->cookie(CGISESSID => $session->id);
$sSid = $session->id();

and setting the cookie:

Code:
print $cgi->header(-cookie=>$cookie);

I want to set the cookie still, but not call up the header...if i call header, then i can't use my redirect.

Code:
print "Location: [URL unfurl="true"]http://uk.topsurveyguide.com/?$sSid\n\n";[/URL]

i want to do this:

Code:
print $cgi->(-cookie=>$cookie);

but of course that doesn't work.

any ideas?

thanks!

- g
 
try using the redirect() function of the CGI module instead of LOCATION. That way you can print the cookies and do the redirect all at once I would think.

------------------------------------------
- Kevin, perl coder unexceptional! [wiggle]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top