Hi@semplicewebsite ,
thanks.
I had now a deeper look and i am sure, that the problem is in your server configuration.
I think your server adds to all cookies which are set by http the values “;HttpOnly;Secure” which makes them not readable for javascript anymore.
What makes me certain:
- The code is pretty straight forward and i can not reproduce this issue on my test system with php 8.1
- In the screenshot you see the header response from your website. You see the set cookie header. the httpOnly and secure looks attached, because all values from my plugin come with spaces after the “;” but the last to not: https://beautiful-cookie-banner.com/screens/Screenshot_11.png
- For cookie nsc_bar_sc_done the httpOnly flag is set by the plugin and it is not the last value. And all cookies are set by the same method in the plugin.
Maybe you have a plugin installed which does that (Firewall configuration?) or the server/load balancer/proxy is configured to do that.
Here for example an article which describes how it is done: https://geekflare.com/wordpress-x-frame-options-httponly-cookie/
I guess there are many ways of implementing it. So this article is just an example of one implementation method. How it is done on your side: i can not tell.
Regards