Beefy Boxes and Bandwidth Generously Provided by pair Networks kudra
Problems? Is your data what you think it is?
 
PerlMonks  

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

by antirice (Priest)
on Jul 02, 2004 at 00:04 UTC ( [id://371296]=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^4: Cookies write to screen, not to cookie file
in thread Cookies write to screen, not to cookie file

This suggestion may tick you off, but it's only a suggestion. You may want to eventually migrate to something like CGI::Application. The way it works is that you build up the output in a run_mode and within this runmode you can change things such as what the headers will print when you're ready to go. HTTP is all text and certain things are expected to happen. Once you get beyond certain points (i.e. headers are already sent) then it's too late to send out cookies or anything else for that matter.

A short-term possibility is to move most of the logic for detecting cookies and whatnot up towards the beginning of the script. Then you just set flags for later use but use them at the beginning while printing out the headers to make certain you send everything you need.

Of course, I may be reading everything incorrectly and coming across as an idiot. If so, then I apologize as I've been up for an extraordinary amount of time.

antirice    
The first rule of Perl club is - use Perl
The
ith rule of Perl club is - follow rule i - 1 for i > 1

  • Comment on Re^5: 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://371296]
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.