S
svilst
How can I change the path of the cookie 'ASP.NET_SessionId'?
The path is "/" and I'd like to set the path to particular virtual
directory.
The following approach does not work:
protected void Session_Start(Object sender, EventArgs e)
{
HttpCookie cookie = Response.Cookies["ASP.NET_SessionId"];
if (cookie != null)
{
cookie.Path = Request.ApplicationPath;
}
}
Because an http cookie is idenitified by name,path and domain combined,
changing only the path effectively creates another cookie. As a result
different strange errors occur on the site. So I believe the above is
not quite right.
Does anybody know whether the path of this particular cookie can be
changed programatically or via configuration settings.
Thanks,
Svilen Stoilov
The path is "/" and I'd like to set the path to particular virtual
directory.
The following approach does not work:
protected void Session_Start(Object sender, EventArgs e)
{
HttpCookie cookie = Response.Cookies["ASP.NET_SessionId"];
if (cookie != null)
{
cookie.Path = Request.ApplicationPath;
}
}
Because an http cookie is idenitified by name,path and domain combined,
changing only the path effectively creates another cookie. As a result
different strange errors occur on the site. So I believe the above is
not quite right.
Does anybody know whether the path of this particular cookie can be
changed programatically or via configuration settings.
Thanks,
Svilen Stoilov