When creating a cookie, how can I specify www and no www cookie?

when I create a cookie for a domain, can I establish that this domain should be both in the www domain and not in the domain?

I check the cookie, and if not, I redirect to the login page (this is not a super safe thing). it seems when the user has a cookie if the url is changed to www. it is redirected again to login.

+3
source share
2 answers

When you drop the cookie, specify .mydomain.com - mark the start period. This should work for both the root domain and the www subdomain.

+4
source

@electronherders , www, no-www. , URL.

+2

Source: https://habr.com/ru/post/1718657/


All Articles