user964147
user964147

Reputation: 739

Checking for Cookie status and restricting the user not to surf the web appkoication - How To?

As known when user logging into the google account if the cookies are disabled in the browser google prompts the 'Activate cookies' message to the user and restricts the login. I want same type of functionality to implent in java for my website. I did not understand how it can be done. I googled this but did not find much related information. It would be great if i receive some valuable comments. Thanks in advance

Upvotes: 0

Views: 85

Answers (1)

mbelow
mbelow

Reputation: 1133

The only reliable test whether cookie are enabled or not is to try it out. Set a cookie on the home page of your app, redirect to another page and test if the cookie is set. This can be done both on the server side using the appropriate HTTP headers, or on the client using JavaScript.

Upvotes: 1

Related Questions