Wednesday, October 28, 2009

Clear ASP.Net Session from another ASP site

We have a 2 web app under our web site, one is asp.net and another one is asp. After user logout from the ASP web app, we need to make sure the ASP.Net site also been logout.

First we try to use Response.Cookie to delete the ASP.NET_SessionId cookie which issued by ASP.Net, but ASP will automatically encode the ASP.NET_SessionId to ASP%2ENET%5FSessionId which will add a new cookie.

So finally we use the Response.AddHeader "Set-Cookie","ASP.NET_SessionId=deleted;Path=/" to solve the problem

2 comments:

Unknown said...

Realy thanks,
this helped me a lot

Unknown said...

Realy thanks,
this helped me a lot