emAmazed / redlamp

Bloggie Bloggie
MIT License
0 stars 1 forks source link

Securing Cookies with HttpOnly and secure Flags #18

Open emAmazed opened 9 years ago

emAmazed commented 9 years ago

Without having HttpOnly and Secure flag in HTTP response header, it is possible to steal or manipulate web application session and cookies.

If the HttpOnly attribute is set on a cookie, then the cookie's value cannot be read or set by client-side JavaScript. Using HttpOnly and Secure flag with client side cookie can mitigate most common XSS attack. This will ensure the site will only run with SSL.

How to set up:

Godusobb commented 6 years ago

Hi, I did Header always edit Set-Cookie (.*) "$1; HTTPOnly; Secure
in my httpd.conf, but when i did restart the services, whenever i click in my site , a new session is created and the previous is destroyed , ( so the problem is that the server keep destroying the previous session after every click)

any clue what is the problem here ?? thanks

emAmazed commented 6 years ago

Hi @Godusobb just saw this. What did you list under "ServerName"? Try to switch it to your machine name if you are working on an intranet, or it was listed with an IP. The cause of it most likely was the cookie was not enabled in the browser, and every time you clicked the site it was considered as a new session.

Godusobb commented 6 years ago

Hi , I found out that i work with tomcat 6.016 and the HttpOnly was added in tomcat 6.019, May that be the problem ?