tags:

views:

215

answers:

2

I have a "cookie" handler / utility class that works quite well for me. It abstracts away a lot of the issues that I drive me crazy when dealing with cookies such as how to handle a response (write) operation followed by a request (read) operation on the same postback, how to handle encryption, etc.

The one thing that eludes me is how to segregate my cookies across different “virtual” domains. My applications are running in an intranet environment all with the same host / server name:

http://server/app1/

http://server/app2/

I don’t want these different applications sharing cookie values in the event that they use the same names. Approaches on the Request / Response object?

+5  A: 

Set the Path property of the Cookie to either /app1 or /app2

John Rasch
+1  A: 
Response.Cookies["CookieName"].Path= "/app1";

() instead of [] if you are using VB syntax.

bobince