Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

How to secure cookie in servlet 2.4

 
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


 
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.
 
Saloon Keeper
Posts: 22503
151
Android Eclipse IDE Tomcat Server Redhat Java 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.
 
The moth suit and wings road is much more exciting than taxes. Or this tiny ad:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
    Bookmark Topic Watch Topic
  • New Topic