Click here to Skip to main content
15,908,175 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Cookie created in javascript not accesable in ts file which is in another project. How can create a cookie that is accesable to all projects.

Thanks

What I have tried:

Tried document.cookie and $.cookie
Posted
Updated 7-Jun-18 1:16am

1 solution

"Projects" are a concept that only exist in the development IDE, they have no relevance to how the code functions as a website.

Assuming you are putting the code from your different projects on different websites, you can't share cookies for security reasons, that's how the internet works. Would you want a malicious site accessing the cookies you use to authenticate with your bank?

The only way you can share cookies is if the sites are on subdomains of each other. So;

site1.project.com

could share cookies with

site2.project.com
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900