没有登录控件的ASP.NET中的登录注销逻辑 [英] Login Logout Logic in ASP.NET whithout login controls

查看:84
本文介绍了没有登录控件的ASP.NET中的登录注销逻辑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在asp.net上的一个项目中工作.我想要的是登录注销逻辑,我现在不使用登录控件,并且我现在不想在此项目中使用它们,我的查询是,每当用户登录时,他查看自己的资料,以及当他注销并单击返回"按钮时浏览器,他必须重定向到其他页面,例如Home.aspx页面.
请帮帮我....
谢谢与问候
Radix

i am working on a project in asp.net. What i want is login logout logic, i am not using login controls and i dont wana use them in this project for now, My query is that whenever a user logs in he views his stuff and when he Sign Outs and clicks on back button of the BROWSER he must be redirected to some other page say for example Home.aspx page.
Please help me out....
Thanks & Regards
Radix

推荐答案

您是不是只是不想使用内置的"asp.net登录控件"?

如果是这样,您仍然需要某种方式从用户那里获取一些凭证并对其进行验证,以便用户登录&向他们发行令牌.否则,您如何判断用户是否登录?

您可以创建自己的登录控制逻辑-我建议您仍然为此使用成员资格提供程序,但可以覆盖&在这里做你喜欢的事.

http://msdn.microsoft.com/en-us/library/yh26yfzy.aspx [ ^ ]

大多数要求您登录的网站都有一个注销"链接,该链接会使令牌无效,并将其重定向回不需要身份验证的某些资源(例如您的首页"页面).我还建议您采用这种方式,而不要尝试弄乱后退"按钮.

正确颁发身份验证令牌+使用页面缓存指令将不允许用户单击后退"按钮查看任何需要身份验证的页面.
Do you mean you don''t just dont want to use the inbuilt ''asp.net login control''?

If so, you still need some sort of way of taking some credentials from the user and validating them so the user is logged in & issuing them a token. Otherwise, how will you tell if the user is logged in or not?

You can create your own login control logic - I suggest you still use the Membership provider for this but you can override & do what you like here.

http://msdn.microsoft.com/en-us/library/yh26yfzy.aspx[^]

Most websites that require you to sign in have a ''log out'' link that will invalidate their token and redirect them back to some resource that doesn''t require authentication (e.g. your ''Home'' page). I also suggest you go this way rather than trying to mess with the ''back'' button.

Correctly issuing an authentication token + use of page cache directives won''t allow the user to click on the ''back'' button to view any pages that require authentication.


这篇关于没有登录控件的ASP.NET中的登录注销逻辑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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