Check if Cookies are enabled using Java or jsp
Posted on 2009-04-28
I have code that looks for a specific cookie and if the system can't find it, we assume that the person is a new visitor and generates a new cookie and stores that number in a database. We use this to count how many times a person comes back to our site.
Problem is, if a person has cookies turned off, then everytime they visit, they get a new number and entry into the database. Using Java or jsp how can I determine if they have cookies turned off. Thus preventing me from needless additions to the database.