CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Intermediate:
cannot read cookie


New User

Mar 10, 2006, 9:53 PM

Post #1 of 3 (546 views)
cannot read cookie Can't Post

Hi all,

one of my app is setting a cookie. I use the following code to read the cookie. it runs fine when the code is hosted on a unix box. but when I host it on a windows machine, it fails reading the cookie. it is quite irritating for me now. any help is appreciated.


print "Content-type:text/html\n\n";

# Modules used
use CGI;
# Create an object of CGI
$query = new CGI;
# Request the cookie set by the application MYCOOKIE
$theCookie = $query->cookie('MYCOOKIE');

print "<b>$theCookie";


Mar 10, 2006, 10:29 PM

Post #2 of 3 (545 views)
Re: [puckpuck] cannot read cookie [In reply to] Can't Post

I think you should get the cookie before printing the http header:


use CGI;
$query = new CGI;
$theCookie = $query->cookie('MYCOOKIE');

print $query->header;
print "<b>$theCookie";


New User

Mar 10, 2006, 10:31 PM

Post #3 of 3 (544 views)
Re: [KevinR] cannot read cookie [In reply to] Can't Post

I got it working. I used the FQDN in the URL to call the script. and for some reason its working now. thanks anyway.


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives