You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by "James.Q.L" <sh...@yahoo.com> on 2003/09/05 05:48:11 UTC

cookie managerment

hi,

in mod_perl how do i detect if users choose to reject the cookie being sent to them and/or having
the cookie disable in browser ? (not javascript or other client-side scripting)  so that i can
print a error message remind user to enable cookie.


Regards,

Qiang

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com


-- 
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html


Re: cookie managerment

Posted by Matt Sergeant <ma...@sergeant.org>.
On 5 Sep 2003, at 04:48, James.Q.L wrote:

> in mod_perl how do i detect if users choose to reject the cookie being 
> sent to them and/or having
> the cookie disable in browser ? (not javascript or other client-side 
> scripting)  so that i can
> print a error message remind user to enable cookie.

Here's a scheme that works for me:

Set the cookie.
Redirect them to a page that expects the cookie.
In your handler, if you're visiting a page that expects the cookie you 
take one of two actions:
    - If the Referer was the page that's supposed to set the cookie, 
send them to the page telling them to turn on cookies.
    - Otherwise send them back to the page that sets the cookie (usually 
a login page).

It's a simple scheme, and relies on Referer which everyone will now 
tell me is bad, but it does work.

Matt.



-- 
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html