List Info

Thread: Cookie Trouble




Cookie Trouble
country flaguser name
United States
2007-02-20 08:45:28
Friends,

I may have to include more code, but maybe this will be
enough for you 
experts to say, "Oh, yeah, there's your problem!"

When a player goes to my website, biblescramble.com, and
attempts to play 
the first level of my game, the output is "Location: 
ht
tp://biblescramble.com/biblescramble7.html" on the
first attempt. At that 
point the lines

print <<EOD;
Set-Cookie: guest=$lastCookie; expires=Wed, 29-Dec-2022
00:00:00 GMT;


EOD

set a cookie. Then if the player goes back and tries again,
or hits the 
refresh button, the game works. This is not optimal.

How can I get it to skip that "Location: 
ht
tp://biblescramble.com/biblescramble7.html"
step???

If you need more details, let me know. If you go to
biblescramble.com an 
play the first game you'll see what I mean. Try twice and
the game will 
work. Delete my cookie from your machine and it will goof up
again.

Thanks!

Jerry Kassebaum

P.S.

The last few lines of the cgi program follow:


print "Location: http://b
iblescramble.com/biblescramble7.htmlnn";

# BOTH returns on the end are vital! One won't do ya!



exit 0;

Why would the process of setting a cookie cause that line to
literally print 
to the screen, when not setting a cookie lets it do what it
says???

____________________________________________________________
_____
Mortgage rates as low as 4.625% - Refinance $150,000 loan
for $579 a month. 
Intro*Terms  http://www.NexTag.com

_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Userslistserv.ActiveState.com
To unsubscribe: http:/
/listserv.ActiveState.com/mailman/mysubs

Re: Cookie Trouble
country flaguser name
United States
2007-02-20 11:37:19
On approximately 2/20/2007 6:45 AM, came the following
characters from 
the keyboard of Jerry Kassebaum:
> Friends,
>
> I may have to include more code, but maybe this will be
enough for you 
> experts to say, "Oh, yeah, there's your
problem!"
>
> When a player goes to my website, biblescramble.com,
and attempts to play 
> the first level of my game, the output is
"Location: 
> ht
tp://biblescramble.com/biblescramble7.html" on the
first attempt. At that 
> point the lines
>
> print <<EOD;
> Set-Cookie: guest=$lastCookie; expires=Wed, 29-Dec-2022
00:00:00 GMT;
>
>
> EOD
>
> set a cookie. Then if the player goes back and tries
again, or hits the 
> refresh button, the game works. This is not optimal.
>
> How can I get it to skip that "Location: 
> ht
tp://biblescramble.com/biblescramble7.html"
step???
>
> If you need more details, let me know. If you go to
biblescramble.com an 
> play the first game you'll see what I mean. Try twice
and the game will 
> work. Delete my cookie from your machine and it will
goof up again.
>
> Thanks!
>
> Jerry Kassebaum
>
> P.S.
>
> The last few lines of the cgi program follow:
>
>
> print "Location: http://b
iblescramble.com/biblescramble7.htmlnn";
>
> # BOTH returns on the end are vital! One won't do ya!
>
>
>
> exit 0;
>
> Why would the process of setting a cookie cause that
line to literally print 
> to the screen, when not setting a cookie lets it do
what it says???
>   

So it sounds to me like you are probably trying to print
HTTP headers 
from your cgi, but the headers have already been printed...
The "BOTH 
returns" comment makes it sound like the Location:
header being printed 
by the line you show is intended to be the last header in
the group of 
HTTP headers produced, the signal of where HTTP headers end
in a stream 
from the web server is a blank line (the 2nd return
generates one).

So if your Location: print happens after some other piece of
code 
already ended the HTTP headers, then it is too late.  You
need to figure 
out where the headers are being generated, and include the
Location: 
header before that, or as part of that.

-- 
Glenn -- http://nevcal.com/
===========================
A protocol is complete when there is nothing left to
remove.
-- Stuart Cheshire, Apple Computer, regarding Zero
Configuration Networking

_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Userslistserv.ActiveState.com
To unsubscribe: http:/
/listserv.ActiveState.com/mailman/mysubs

Re: Cookie Trouble
country flaguser name
United States
2007-02-20 16:52:31
Jerry Kassebaum wrote:
> 
> If you need more details, let me know. If you go to
biblescramble.com an 
> play the first game you'll see what I mean. Try twice
and the game will 
> work. Delete my cookie from your machine and it will
goof up again.

1) Create a new script that has only the code needed to
reproduce the
problem (and possibly a link to an HTML page that calls the
new script
rather than calling the script direct - if that matters).

2) State exactly what happens when this new script fails and
what it
should have done instead.

3) Post the entire new script (it should be less than 10
lines from your
desc.).

_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Userslistserv.ActiveState.com
To unsubscribe: http:/
/listserv.ActiveState.com/mailman/mysubs

[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )