http://www.perlmonks.org?node_id=231785

nop has asked for the wisdom of the Perl Monks concerning the following question:

Hi folks,
If a mod_perl script attempts to set a cookie, how can you determine at that time if the cookie was successfully accepted?
Thanks
nop

Replies are listed 'Best First'.
Re: Determining if a cookie was accepted
by PodMaster (Abbot) on Feb 01, 2003 at 03:08 UTC
Re: Determining if a cookie was accepted
by dempa (Friar) on Feb 01, 2003 at 03:06 UTC

    Cookies are sent in the http headers and if I'm not mistaken there's no way to determine if the client accepted or rejected them. The only thing I can think of is to check for the cookie next time the user requests a page (but that's probably not what you want since you write "at that time").

    -- 
    dempa

Re: Determining if a cookie was accepted
by glwtta (Hermit) on Feb 01, 2003 at 03:38 UTC
    hm, I suppose after sending the header you could print a small javascript function that would send another request (lots of options there) to a script which, after checking what cookies it gets, would set a flag (with your favourite shared memory / IPC mechanism) for which your first script would have to wait.

    Though that doesn't sound like that good a solution to me... in fact, I don't even know if that would work, Monks?