单击注销页面后如何创建注销页面不要在asp.net中返回 [英] how to create log out page after click log out page donot come back in asp.net

查看:108
本文介绍了单击注销页面后如何创建注销页面不要在asp.net中返回的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

单击注销页面后如何创建注销页面,请不要在asp.net中返回
我用这个


how to create log out page after click log out page donot come back in asp.net
i use this


Response.Cache.SetCacheability(HttpCacheability.NoCache);
        Response.Cache.SetExpires(DateTime.Now.AddSeconds(-1));
        Response.Cache.SetNoStore();
    }
<pre lang="vb">Session.Abandon()
        Response.Cache.SetExpires(DateTime.UtcNow.AddMinutes(-1))
        Response.Cache.SetCacheability(HttpCacheability.NoCache)
        Response.Cache.SetNoStore()
        FormsAuthentication.SignOut()
        Response.Redirect(&quot;~/Home.aspx?val=1&quot;)</pre>


但是这些代码无法正常工作,请在成功进行身份验证后的登录页面中帮助


but these code are not working in a proper way please help

推荐答案

.

单击注销后,无效的用户会话.
在每个页面的page_load事件中,检查会话是否为null,如果为null,则重定向用户以登录页面.

如果不为null,则显示用户请求的页面.

很抱歉,我无法发布与此代码有关的代码.

Google 中搜索以下

ASP.NET中的身份验证和授权.
状态管理(Cookie,会话,缓存,查看状态)ASP.NET
ASP.NET中的登录控件
In the login page after successful authentication create user session.

On clicking log out invalidate user session.
At the page_load event of each page check if the session is null or not,if it is null redirect user to log in page.

If not null display the page that user has requested.

And sorry I cannot post code related to this one.

Search Google for the following

Authentication and Authorization in ASP.NET.
State Management(Cookies,sessions,Caching,View State) ASP.NET
Login Controls in ASP.NET


这篇关于单击注销页面后如何创建注销页面不要在asp.net中返回的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆