MVC中的认证方法 [英] Authentication method in MVC

查看:100
本文介绍了MVC中的认证方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

HI,

Is there any method other than authenticating a user other than forms auth. In MVC forms authentication hoe can we use sessions, Or is there any method to get the loggged in user details. I did by checking count of a user in DB for loggging in and use sessions for maintaining and clear cache for back button isue. I am confused with forms.

Please help

推荐答案

您只需将登录用户的ID存储在会话中并写入一种身份验证方法,用于检查并将该属性添加到您登录的方法中。
You can just store the id of the logged in user in the session and write an authentication method which checks that, and add that attribute to your logged in methods.


这篇关于MVC中的认证方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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