My website is on Apache which is hosted in AWS VPS.
I tried setting http-only flag and secure flag by editing security.conf file but upon checking the headers via https://hackertarget.com/http-header-check/ I see that there is no change and cookies are still without these flags.
I followed these steps:
Ensure you have mod_headers.so enabled in Apache HTTP server
Add following entry in /etc/apache2/conf-enabled/security.conf
Header edit Set-Cookie ^(.*)$ $1;HttpOnly;Secure
Restart Apache HTTP server to test
Can anyone help me out?
Try to set the last part in "" like i did here:
After that try a apache syntax check with:
Very good test for header security is the one from mozilla:
There can be two reasons for set-cookie flag not working:
If it is the first case, this answer will work as it worked for me.