choop
choop

Reputation: 921

Passing cookies from domain to sub domain

I have a site with domain www.foo.com and we used to save our cookies with www.foo.com. From now on we want to add sub domain to our site test.foo.com and because of that i can't get to the old cookies that used to be save on www.foo.com.

So I changed the cookies to by more general .foo.com, but i still can't get to old visitors with www.foo.com.

Is there is a way to solve it? (client/server side)

Upvotes: 2

Views: 1297

Answers (2)

You can set the Domain in Cookies properties like Domain=xx.Domain.com this is Suggestion 1

and Second way is by make a page like CookiesManipulation.Aspx in the Sub Domain and Pass the Cookies ID and Value to that page like xx.Domain.Com/CookiesManipulation.Aspx ?UserName=Choop.

Web site Can help you

I hope that I have help u.

Upvotes: 0

adarshr
adarshr

Reputation: 62583

Just bind your cookies to the domain .foo.com instead of www.foo.com. The dot prefix acts as a wildcard, making your cookies visible across subdomains.

Upvotes: 1

Related Questions