: Can I share a cookie with a subdomain? Suppose I want my site to be accessible at https://www.example.com and https://example.com. Is it possible to set a cookie when visiting one domain so
Suppose I want my site to be accessible at www.example.com and example.com.
Is it possible to set a cookie when visiting one domain so that it is accessible in the other?
More posts by @Sue5673885
1 Comments
Sorted by latest first Latest Oldest Best
Yes you can, try setting the cookie for .example.com as domain. That way, the cookie will be valid for every subdomain of yours.
For example, PHP sessions would be like this: session_set_cookie_params(0, '/', '.example.com');
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.