English 中文(简体)
记录表
原标题:Storing ASP.NET MVC 2 session data on login

I ve got a implementation similar to this: 更妥善地进行高度类型的伙伴关系。 NET MVC 会议

供迅速查阅经常需要用户数据......但有两个问题:

(1) 用户何时被拖拉,但会议将无效或重新开始? 我始终认为,只要用户在会议上签字,其会议就有效......。

2) 在用户记录中,我想填满数据,但我不知道如何在标识上查阅这些数据。 账户主计长有一套记录仪,但尽管有表格。 签字 在方法上,我看不出它实际上在使用者中签字的情况,因为成员是成员。 GetUser () 返回无效,直至AFTER 网页改头......

我猜测,我这样做是错误的,我不应该试图采用一种通用的方法来检索本届会议,而是将个别方法绘制到届会的数值上,如果这些方法无效,就会从用户数据中人工重新加以传播。

你认为什么?

最佳回答
  1. There s a difference between session and authentication. Session is available throughout the whole application, even if a user is not signed in.
  2. In the default ASP.NET MVC 2.0 project template you can populate the session data just after the call of FormsService.SignIn. This is where the user credentials have been validated and an authentication cookie will is written to the response. You can use the provided username to fetch any user information from the database if you need to.
问题回答

暂无回答




相关问题
why the session in iis automatically log out?

I used iis6, and when i called a function Directory.delete(), the all the session relate this website will be logged out. and i debugged the website, i found no exception. any one have ideas on this ? ...

Check session from a view in CodeIgniter

What is the best way to check session from a view in CodeIgniter, it shows no way in their user guide, otherwise I will have to make two views on everything, which is kinda weird...still a newbie to ...

Can I get the size of a Session object in bytes in c#?

Is it possible to get the size(in bytes) of a Session object after storing something such as a datatable inside it? I want to get the size of a particular Session object, such as Session["table1"], ...

提供严格分类的出席会议物体

提供严格分类的与会机会的最佳方式是什么? 我正计划转而选择矩阵,这正在促使汇编者抱怨我的幻觉方案拟订方法......

PHP Session is not destroying after user logout

I m trying to create an authentication mechanism for my PHP Application and I m having difficulty destroying the session. I ve tried unsetting the authentication token which was previously set within ...

热门标签