Help coderanch get a
new server
by contributing to the fundraiser
  • 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to secure cookie in servlet 2.4

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 27926
198
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
And will you succeed? Yes you will indeed! (98 and 3/4 % guaranteed) - Seuss. tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic