XF 2.0 HTTP Only Cookies

Nirjonadda

Well-known member
I want add rules for HTTP Only Cookies but Having problem from COOKIE: xf_session attributes are set twice.


Code:
# Secure cookie with HttpOnly
Header always edit Set-Cookie (.*) "$1; HTTPOnly"

Why its adding Some attributes are set twice?

Code:
Set-Cookie xf_session=jvyzZlRlRQKYSrOkqswLnVD2vQNQmE63; path=/; secure; HttpOnly; HTTPOnly

4ngb9NBLRqqhGx1JJso4AA.png
 
The change you're making is very likely to break things. Please don't apply it. We use HTTP-only cookies where appropriate.
 
@Mike Can you confirm that the alert "'httpOnly' flag is not set on this cookie." from the website header checker https://securityheaders.com/ is still not a concern in 2020?

I understand these are just general advisements and not necessarily an error or risk. We've been tightening down security on the server headers this weekend.

Mike
 
I've had several members complain about getting a "Not Secure" messages on the new Edge and Firefox browsers. The xf_csrf cookie was the only thing I found on any of the posts showing as unsecure. Is this a false positive or something I can correct in the configuration?
 
I'm pretty sure what you're referring to is when the site doesn't use HTTPS. Looking at the URL in your customer area, you do support HTTPS but you don't seem to enforce it. You can enforce that via .htaccess or by enabling "Enable board URL canonicalization" (provided your board URL is correct/using HTTPS).
 
@Mike Thank you for the suggestion, but it didn't seem to help. We are enforcing the url to https. The Enable Board URL Canonicalization was unchecked, but checking it didn't seem to change the behavior.

Clicking the Not secure part of the address bar doesn't show anything as blocked or what is causing it to show as Not Secure.
unsecure_edge.webp

I used a third party scanner to check the same url, which identified the xf_csrf as unsecure.
unsecure_cookie.webp
 
Top Bottom