Hi,
If I need to check, if the user opted to accepts cookie or not (a setting, which browser user would've set), how do I acheive this using Java. I know to do the same using javascipt. but let me know if this is achievable using Java.
Thanks in advance
Veena
-
Check where the user Accepts the cookie (1 messages)
- Posted by: Veena
- Posted on: March 14 2005 03:37 EST
Threaded Messages (1)
- Check where the user Accepts the cookie by Bill Lasley on March 15 2005 13:01 EST
-
Check where the user Accepts the cookie[ Go to top ]
- Posted by: Bill Lasley
- Posted on: March 15 2005 13:01 EST
- in response to Veena
I believe you can just do this, in your servlet, using the HttpServletRequest object.
if(request.getCookies() == null) {
// cookies are not enabled, redirect to error page or whatever you want to do
...
}
You could also try:
// if true, then cookies are not enabled because the session id is in URL
if (request.isRequestedSessionIdFromURL() )
Bill Lasley
Versant Corp.
http://www.versant.com