Click here to Skip to main content
15,943,477 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to resolve cookie path attribute mapped to root folder in ASP.NET


I have done

protected void Application_EndRequest(Object sender, EventArgs e)
       {
           // Iterate through any cookies found in the Response object.
           foreach (string cookieName in Response.Cookies.AllKeys)
           {
               Response.Cookies[cookieName].Secure = true;
               Response.Cookies[cookieName].Path = ConfigurationManager.AppSettings["UserDefiniedCookiePathFilter"];
           }
       }


But its still showing the default path.
how can i achieve this.is there any common code or any web config setting to set default path of cookie?

i want to do it from global.asax file.


What I have tried:

protected void Application_EndRequest(Object sender, EventArgs e)
       {
           // Iterate through any cookies found in the Response object.
           foreach (string cookieName in Response.Cookies.AllKeys)
           {
               Response.Cookies[cookieName].Secure = true;
               Response.Cookies[cookieName].Path = ConfigurationManager.AppSettings["UserDefiniedCookiePathFilter"];
           }
       }
Posted

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