• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to set httponly to false for a secure cookie in servlet2.5

 
Kala Saseendran
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As below i m creating cookie .



I am trying to read that cookie in javascript as below.

var cookieValue = $.cookie("myck");

I can see the cookie in the browser. However the read is not happening I tried to set httponly to false



However it is throwing compilation error as my servlet version is 2.5

Is there any way to get the cookie in javascript?
 
Rob Spoor
Sheriff
Posts: 20817
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First of all, are you sure that the cookie is HTTP only? You can check in Chrome by checking the Resources section of the Developer Tools, then Cookies, the site, then the HTTP column.

If it is, you will probably have to forget about using the Cookie class, and set the Set-Cookie header manually. That's not going to be a nice task though, because you also have to beware that you don't erase any other cookies.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!