一页中进行多个会话检查 [英] multiple session checking in one page

查看:66
本文介绍了一页中进行多个会话检查的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道可以在一页上检查多个会话.如果是,怎么办?

因为我正在为管理员以及用户侧的特殊用户使用某些相同的任务.所以我不想在用户端重复.如果解决了此问题,则两次不会发生相同的事情.

例如,在管理面板中创建两个报告,并且在两个页面加载事件中仅检查一个管理会话.以便将两个报告显示给用户端的某些特殊用户.

请帮帮我..
Mitesh

i want to know that it is possible to check multiple session on one page. if yes, how ?

because i am using some task same for Admin as well as special user at user side. so i do not want repetation to do in user side. if this problem solved, same things be not happend two times.

e.g in admin panel create two reports and in both page load event check only one admin session. so that both report shown to the some special user at user side.

Please Help Me..
Mitesh

推荐答案

对于会话,答案是否定的.这些都是基于用户的,因此无法使用此机制共享数据.

但是,您还应该考虑其他一些选择.

1)如果您将角色提供程序与ASP.NET一起使用(我认为您是指ASP.NET),则应该为每个用户分配一个角色.使用角色提供程序,您可以轻松区分谁是管理员和谁是普通用户.

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

2)考虑使用应用程序状态.这与会话相同,但对所有用户全局可用.状态中可能有一些令牌或信息可用于区分谁在线等.这与会话状态的使用方式相同.

到应用程序状态的演练 [在ASP.NET中进行缓存 [
The answer is no for session. These are user based and it is not possible to share data using this mechanism.

However, there are a few other options you should consider.

1) If you are using the roles provider with ASP.NET (I take it that you are referring to ASP.NET) you should have a role assigned to each user. Using the roles provider you could easily distinguish between who is admin and who is a normal user.

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

2) Consider using application state. This is the same as session but is globally available to all users. There could be some token or information in the state that could be used to distinguish who is online etc. This is used in the same way as session state.

A Walkthrough to Application State[^]

3) use the asp.net caching to store data or information:

Caching in ASP.NET[^]


这篇关于一页中进行多个会话检查的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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