如何在ASP.NEt中创建会话 [英] How Make Session in ASP.NEt

查看:83
本文介绍了如何在ASP.NEt中创建会话的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何制作会话?



i想要



一个用户名只能登录一个系统,如果已经登录系统生成消息的另一个系统

你已经在另一台PC上登录了



i希望会话编码不应该全部写入页面

表示global.asax或其他任何静态方法???

及其对我网站的安全性?

请告诉我这个场景

How Make Session?

i want that

one username should login only one system, if already login on another system that system generate message
"You Are Already Login on Another PC"

i want Session coding should not write on all pages
mean global.asax or other any static method ???
and its secure for my website?
plz tell me this scenerio

推荐答案

1。当用户登录时,在数据库中维护一个标志为LoggedIn以及用户的IP地址



2.如果用户尝试从任何其他用户登录系统只需用用户名,LoggedIn(状态),IP地址检查数据库表,然后根据结果向他显示一条消息。





3.当用户的会话到期时,将LoggedIn状态重置为false。
1. When ever the user logs in maintain a flag in the database as "LoggedIn" along with IP address of the user

2. If the user trying to login from any other system just check the database table with the user name, LoggedIn(status), IP address then show him a message according to the result.


3. Reset the "LoggedIn" Status to false when the session of the user expires.


这篇关于如何在ASP.NEt中创建会话的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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