Foredoomed
Foredoomed

Reputation: 2239

How to disable cookie in a programming way

Generally for Java developers, if we use the Servlet APIs to store data in the session, the sessionid will be stored in the cookie. If the client disabled the cookie, the jsessionid will be pending to the URL.

Now i want to use the jsessionid mechanism, so I just want to ask that is there a way to disable the cookie by programming, not changing the web browser's settings.

Upvotes: 3

Views: 1706

Answers (1)

Sanjay T. Sharma
Sanjay T. Sharma

Reputation: 23208

AFAIK, there is no standard way of doing this. But I think containers do provide an option of turning off session tracking based on cookies. For e.g. this article mentions a property which seems to turn on cookies for session tracking. Similarly, Tomcat allows for a "cookies=true" in its Context.xml file or server xml file.

Upvotes: 3

Related Questions