Beefy Boxes and Bandwidth Generously Provided by pair Networks vroom
P is for Practical
 
PerlMonks  

Re^3: Cookies write to screen, not to cookie file

by chromatic (Archbishop)
on Jul 01, 2004 at 19:42 UTC ( [id://371262]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Re^2: Cookies write to screen, not to cookie file
in thread Cookies write to screen, not to cookie file

I need to collect the data before I can write it out.

Yes, that is true. However, this means that the user will have to click a link that sends the information or submit a form that sends the information before you can set a cookie.

You need some logic in your script that can detect whether the user already has a cookie, has just submitted data that you can use to set a cookie, or has no cookie or cookie-making data. Only then can you solve this problem.

Also keep in mind that you cannot set a cookie and read its values in the same invocation. I think this is what's confusing you most right here. CGI programming is rather like a conversation between two very polite people who never interrupt and wait for a complete response before answering back.

  • Comment on Re^3: Cookies write to screen, not to cookie file

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://371262]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.