Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Re^2: CGI::Cookie problem in FF and IE

by Errto (Vicar)
on Aug 07, 2007 at 03:16 UTC ( #630944=note: print w/replies, xml ) Need Help??

in reply to Re: CGI::Cookie problem in FF and IE
in thread CGI::Cookie problem in FF and IE

Hello proceng,

Welcome to the Monastery. I took a look at your code and I notice that actually the complete version you posted is quite different from the smaller section you posted in your original question, so I'll try to respond to both.

As for your original question, my best guess as to why the cookie is not appearing comes from using the Unix command date to generate your query value. This string will have a newline on the end of it which may confuse your browser. One way to handle this, if that's really the value you want to use, is

my $value = `date`; chomp $value;

However, in the larger update you posted, the code appears to be working correctly. The code generates a cookie called "User-Name" and that is indeed what the browser shows.

Replies are listed 'Best First'.
Re^3: CGI::Cookie problem in FF and IE
by proceng (Scribe) on Aug 07, 2007 at 14:10 UTC
    The problem that I have seen (the date command was simply to create changed data on each iteration w/o changing the code) is that the cookie does not show up in the "show cookies" list and is not retrieved in either FF or IE. With your suggestion, the newline is not transferred, but the cookie still is not set in FF even though it is sent as shown in the HTTP header.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://630944]
[stevieb]: I have got ready everything in a stable manner to go forward with a full-blown "Raspberry Pi with Perl" series, and at the same time "Automated testing locally for everything" series. A year it took. A year I've been waiting to do this.

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (5)
As of 2017-06-29 01:32 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (653 votes). Check out past polls.