Add HttpOnly flag to cookies on the fly with Apache?

Posted by Zack on Stack Overflow See other posts from Stack Overflow or by Zack
Published on 2011-02-14T23:10:37Z Indexed on 2011/02/15 7:25 UTC
Read the original article Hit count: 227

Filed under:
|
|
|

So I have a java webapp that uses tomcat with an apache proxy layer. I'm looking to make all cookies set from the app have the httpOnly flag. The problem with this is that tomcat is responsible for setting the flag from the application side and its default (in servlet api 2.5) is false. I was hoping I could set this flag for all cookies on the fly using apache.

I've been trying different combinations and the closest I have gotten is setting the last cookie passed to httpOnly which is of course wrong:

Header append Set-Cookie "; HttpOnly"

I have no way of knowing what cookies/values are going to be passed from the app. Is this even possible?

© Stack Overflow or respective owner

Related posts about java

Related posts about apache