How can I get the httponly value for a cookie and retrieve the value so that I can print it out?

How can I get the httponly value for a cookie and retrieve the value so that I can print it out?  I want to do this in a J2EE/Struts application.
jwright9Asked:
Who is Participating?
 
rrzConnect With a Mentor Commented:
According to the API
public void setHttpOnly(boolean isHttpOnly)  Marks or unmarks this cookie as HttpOnly.
public boolean isHttpOnly()  Checks whether this cookie has been marked as HttpOnly.  
So, we can set it , and we can check if it has been set.
0
 
Dave BaldwinFixer of ProblemsCommented:
When I look at cookies in the Request Header, all I see are the name/value pairs, no other info about the cookies is passed.
0
 
rrzCommented:
What server are you using ?  
In Java Servlet API 3.0   , the Cookie class has the method  isHttpOnly() .  
0
 
Dave BaldwinFixer of ProblemsCommented:
I think you will find that 'httponly' can only be set, not read.  See here: http://en.wikipedia.org/wiki/HTTP_cookie#Cookie_attributes
0
 
Dave BaldwinFixer of ProblemsCommented:
But you can't read it back from the browser to know how it is set in the browser.
0
All Courses

From novice to tech pro — start learning today.