vb.net - Session variables not clearing after Session.Clear() and Session.Abandon() in ASP.NET -
after running penetration tests on our site, our security pointed out session id's on our server doesn't cleared out after users log out.
our code clear session follows:
session.clear() session.removeall() session.abandon() dim cookie1 httpcookie = new httpcookie(formsauthentication.formscookiename, "") cookie1.expires = datetime.now.addyears(-1) response.cookies.add(cookie1) dim cookie2 httpcookie = new httpcookie("asp.net_sessionid", "") cookie2.expires = datetime.now.addyears(-1) response.cookies.add(cookie2) formsauthentication.signout() formsauthentication.redirecttologinpage()
we confirmed having usera log in , forging cookies based on login. after usera logs out, log in userb , expected, acquired session values stored in usera's sessionid.
is there other way clear session data?
as per msdn, session.clear
, session.removeall
same thing. need call before call clear
:
system.web.security.formsauthentication.signout()
Comments
Post a Comment