tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Power-Netz \(Schwarz\)" <schw...@power-netz.de>
Subject AW: Detect Cookie Rejection
Date Tue, 04 Jun 2002 08:21:14 GMT
> Does anyone know of a way to detect when cookies are not accepted
> by a browser.  My site uses session cookies and I'd like to be
> able to redirect people somewhere to tell them that the site
> requires cookies and what to do to activate them...

An easy way to find out if cookies are enabled AND working is
to set something in a bean scope=session , refresh to a different side
and check if the session.isNew()=true or if the usedbean has reconstructed
( singleton counter )

why?

session.isNew() will allways return true, because the session can't not be
tracked without the cookie
(ofcourse only if you are NOT USEING urlEncode() ) [That's what i learn from
last weeks posting :-)]

Your bean will be constructed because the session is new. new session -> new
beans.

Make something out of it.. :)


--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message