3

We have a web application that is using a cookie to store a code.

The domain of the cookie is 'www.mydomain.com'.

We've made rewrite rules to create the cookie for customers entering on spesific urls: RewriteRule ^/example.* https://www.mydomain.no/somepage [co=codeCookie:123456:www.mydomain.no]

The cookie is created, but with a leading dot in the domain name: '.www.mydomain.com'. Which the web application doesn't read.

We've tried to set the domain name to '.mydomain.com' (which works as intended), but the web application doesn't read that either.

Is there a way to omit the leading dot in the cookie domain?

Hjallmar
  • 31
  • 2

1 Answers1

3

After much pain and suffering, I tried the following;

RewriteRule ^(.*)$ /index.php/$1 [L,PT,CO=open_id_session_id:123:;]

and it worked!

Tom
  • 3,324
  • 1
  • 31
  • 42
  • Setting an empty domain for the cookie works fine with Firefox, Chrome or Edge (Chromium). The browser resolves it to the current domain without the leading dot, but Internet Explorer 11 (Windows 10) seems to dislike it, and ignores the cookie – David Le Borgne Dec 01 '20 at 15:56