2
기본 멤버십 컨트롤을 사용하는 ASP.NET 2010 웹 앱이 있습니다. 로그인하면 마스터의 로그인 컨트롤이 로그 아웃 컨트롤을 표시합니다. 내가 그것을 클릭하면 Default 페이지로 리다이렉트하지만 인증 된 페이지로 다시 이동하면 그 페이지로 들어갈 수있다. 그래서 로그 아웃 링크를 클릭하면 쿠키가 삭제되도록 다음 코드를 추가했다. ,ASP.NET 2010에서 세션 쿠키를 제거하려면 어떻게합니까?
FormsAuthentication.SignOut()
Session.Abandon()
하지만 여전히 인증 된 페이지로 이동할 수 있습니다. 실제로 브라우저를 닫고 다시 열면 멈추게됩니다.
다음내 Web.config의이 ....
<authentication mode="Forms">
<forms
name=".ASPXAUTH"
loginUrl="~/Account/Login.aspx"
protection="All"
timeout="2880"
slidingExpiration="true"
defaultUrl="~/Authenticated/User/UserHome.aspx"
/>
</authentication>
<membership>
<providers>
<clear/>
<add name="AspNetSqlMembershipProvider"
passwordFormat="Hashed"
type="System.Web.Security.SqlMembershipProvider"
connectionStringName="ApplicationServices"
enablePasswordRetrieval="false"
enablePasswordReset="true"
requiresQuestionAndAnswer="false"
requiresUniqueEmail="false"
maxInvalidPasswordAttempts="5"
minRequiredPasswordLength="6"
minRequiredNonalphanumericCharacters="0"
passwordAttemptWindow="10"
applicationName="/"/>
</providers>
</membership>
<profile>
<providers>
<clear/>
<add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/"/>
</providers>
</profile>
<roleManager enabled="true">
<providers>
<clear />
<add connectionStringName="ApplicationServices" applicationName="/"
name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" />
<add applicationName="/" name="AspNetWindowsTokenRoleProvider"
type="System.Web.Security.WindowsTokenRoleProvider" />
</providers>
</roleManager>
web.config를 표시 할 수 있습니까? –
귀하의 승인 섹션을 게시하십시오. 가지고 있지 않으면이 동작을 설명합니다. – mxmissile