Go Back

Changing the Path on the ASP.NET Session Cookie

Function Session_Start(Object sender, EventArgs e)

Dim mycookie As HttpCookie

mycookie =NewHttpCookie(Response.Cookies("ASP.NET_SessionId").Name,Response.Cookies("ASP.NET_SessionId").Value)

Response.Cookies.Remove("ASP.NET_SessionId")

mycookie.Path = "/MyApp"

Response.Cookies.Add(mycookie)

End Function


'''Great work Mike Collier at Commerce Bank for figuring this one out! If any of this VB isn't good, i plea that i'm a c# guy.

'this goes in the global.asax.vb file


Facebook DZone It! Digg It! StumbleUpon Technorati Del.icio.us NewsVine Reddit Blinklist Furl it!

Post a comment!
  1. Formatting options