How to set cookie for specific domain
See original GitHub issueI am trying to set cookie for a domain but its not working. Here is my code:
this.cookieService.set('merchant_data', cookieData, expire, '/', 'abc.example.com');
its not working but when I remove domain it works , how can I set it for domain ?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Creating a JavaScript cookie on a domain and reading it ...
Just set the domain and path attributes on your cookie, like: <script type="text/javascript"> var cookieName = 'HelloWorld'; var cookieValue ...
Read more >Set-Cookie - HTTP - MDN Web Docs
The Set-Cookie HTTP response header is used to send a cookie from the server to the user agent, so that the user agent...
Read more >Working With Cookies and Creating Cookies in JavaScript
If Domain is not specified, the cookie can only be read by the exact domain that has set the cookie. This can be...
Read more >Cookies, document.cookie - The Modern JavaScript Tutorial
To find a particular cookie, we can split document.cookie by ; ... By default, a cookie is accessible only at the domain that...
Read more >How to set a cookie to a specific domain in selenium ...
We can set a cookie to a specific domain in Selenium webdriver with Python. A cookie is used to hold information sent by...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I am also facing same problem
@dhananjaykumar880 @kumaraditya1999
Hello,
reading my comment above, I realize that I did not make this point clear enough. If you check out the first of the links above, you will see that you cannot set cookies for other domains. That is also stated in our documentation.
Cheers