Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to secure cookie in servlet 2.4  RSS feed

 
Neha Kulkarni
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does any one know how to secure cookie in servlet 2.4?

I know, i cant use this below...is there any alternative way


 
A.J. Côté
Ranch Hand
Posts: 417
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Secure cookie only means your session cookie should not be sent over plain http, only through through https (TLS) if the browser supports the secure cookie flag..

Use it only if your server needs the cookie only for https (TLS) access.

Note: old versions of TLS used to be called SSL but the term SSL is pretty out of date.
 
Tim Holloway
Bartender
Posts: 18713
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The best way to "secure a cookie" is not to use one at all. Keep the data server-side.

The second-best way is to only transmit it via SSL/TLS.

The jsessionid cookie is a special case, since it may exist before the user switched to secure communications (usually by logging in). In that particular case, the value of jsessionID is changed AFTER entering secure communications mode and the original jsessionid value becomes meaningless. Which is why webapps and server-side code should not play with the jsessionid themselves.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!