ユーザー認証にフォーム認証を使用しています。ログイン資格情報を使用してページにログインした後default.aspx
、default.aspx ページからサインアウトし、ページにリダイレクトしlogin.aspx
ます。その後default.aspx
、IE アドレス バーから直接選択してページ ページを読み込もうとすると、以前の資格情報を使用してそのページを読み込むことができました。これがサインアウトコードです。
protected void Signout_Click(object sender, EventArgs e)
{
FormsAuthentication.SignOut();
Session.Clear();
Response.Redirect("Logon.aspx");
}
これがweb.configの認証部分です
<authentication mode="Forms">
<forms loginUrl="logon.aspx" name=".ASPXFORMSAUTH" protection="All" path="/" slidingExpiration="true" timeout="60">
</forms>
</authentication>
<authorization>
<deny users="?"/>
</authorization>
プロセスは次のとおりです。
1. Login to default page using login credential
2. sign out from default page
3. select the default page directly from address bar.