0

I am trying to write a PoC in a website. I created a cookie storing some information in domain.com, and wish that the cookie is also available in app.domain.com/*. However the MSDN docs about domain in cookies is not very clear about this. Is that by any means possible using javascript?

document.cookie = `Code=${code.toString()}; expires= #${someDateObj}; path=/; domain=domain.com`

Expected results: After the cookie is made available inside domain.com, when I go to anywhere inside app.domain.com/* and domain.com/* the cookie is still available for fetching.

  • Does this answer your question? [Share cookie between subdomain and domain](https://stackoverflow.com/questions/18492576/share-cookie-between-subdomain-and-domain) – Wiktor Zychla Nov 18 '22 at 07:33

0 Answers0