asp.net 인증을 위해 하위 도메인에 의해 설정된 쿠키를 수동으로 제거하려면 어떻게합니까?수동으로 asp.net 인증 쿠키를 제거하십시오.
쿠키는 setter.test.com
;
public ActionResult LogOut()
{
//Manually remove the cookie created by 3rd party authentication
if (Request.Cookies[".ASPXAUTH"] != null)
{
HttpCookie myCookie = new HttpCookie(".ASPXAUTH");
myCookie.Expires = DateTime.Now.AddDays(-1d);
Response.Cookies.Add(myCookie);
}
}
이 작동하지 않습니다 getter.test.com
에서 내 응용 프로그램에서
<authentication mode="Forms">
<forms domain="test.com" loginUrl="Default.aspx" protection="All" path="/" requireSSL="false" timeout="45" name=".ASPXAUTH" slidingExpiration="true" defaultUrl="Default.aspx" cookieless="UseDeviceProfile" enableCrossAppRedirects="false"/>
</authentication>
이 (즉, 쿠키 제거) 로그 아웃 내 코드입니다.
를 참조하십시오 최상위 도메인? –
설정에서 읽거나 특정 방식으로 확인해야합니다. 반드시 쿠키를 가져야합니다. 요청 쿠키에서 가져올 수 있습니다. –
[RFC 6265] (http://www.rfc-editor.org/rfc/rfc6265.txt) 당 4.2.2 절 " 특히, 서버는 쿠키가 만료 될 때, 쿠키가 유효한 호스트, 쿠키가 유효한 경로 또는 쿠키가 설정되었는지 여부에 관계없이 쿠키 헤더만으로는 서버를 확인할 수 없습니다. 보안 또는 HttpOnly 특성. " – HABO