Getting cookie values ​​from different domains

I have a website like mysite.com that stores a cookie when a user logs in, etc.

But my search page has a different subdomain / domain search.mysite.com.

How to get cookie from mysite.com? when I try to retrieve a cookie using the search appliance. he gets me a cookie for search.mysite.com. I need cookie values ​​from mysite.com.

Is there a way to extract a cookie from mysite.com?

thank

+3
source share
1 answer

You must set the cookie to ".mysite.com". All subdomains will have access. The syntax for the Set-Cookie header is as follows:

Set-Cookie: name=newvalue; expires=date; path=/; domain=.mysite.com
+4
source

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


All Articles