0

I have looked around StackOverflow and already found (1, 2, 3, 4)some useful info but not the exact use case that I'm trying to solve.

I'm trying to share information through server cookies for three or four different apps that share a domain but the sub-domains are a bit unusual. Moreover, I'd like to separate the cookies for the development/staging environment from the live/production environments so that cookies created by the Live environment are not readable when visiting the staging ones.

So, this is how my domains look like:

application 1) staging: "stgApp1.MyCompany.com", Live: "app1.MyCompany.com"

application 2) staging: "stgCase.App1.MyCompany.com", Live: "case.App1.MyCompany.com"
//Please note that application 2 is a certain use-case of application 1

application 2) staging: "stgApp3.MyCompany.com", Live: "app3.MyCompany.com"

Can I add these domains to each cookie individually?

Let's say something like this:

mycookie.domain="stgApp1.MyCompany.com,stgCase.App1.MyCompany.com,stgApp3.MyCompany.com"

or should I create three individual cookies for the staging environment and three for the live environments?

P.S. If it helps I'm writing the code in C#.

AleX_
  • 409
  • 7
  • 16

0 Answers0