asp.net - How to tell FormsAuthentication.SignOut() to use a specific cookie path? -


why there no strcookiepath parameter in formsauthentication.signout()?

if pass strcookiepath formsauthentication.setauthcookie(), signout() method no longer work (it "deletes" cookie web.config's cookie path).

how tell signout() use specific strcookiepath?

i'm afraid have use custom signout method if using custom path. method manually expire cookie. like:

httpcookie cookie = new httpcookie(formsauthentication.formscookiename, cookievalue); cookie.httponly = true; cookie.path = /*the path used in formsauthentication.setauthcookie()*/; cookie.expires = new system.datetime(1999, 10, 12); /*some past date*/ cookie.domain = /*custom domain if configured*/;   context.response.cookies.removecookie(formsauthentication.formscookiename); context.response.cookies.add(cookie); 

Comments