如何防止使用不同选项卡在同一个bowser中多次登录 [英] How to prevent multiple login in same bowser with different tabs

查看:102
本文介绍了如何防止使用不同选项卡在同一个bowser中多次登录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨朋友们,

我有关于我的asp.net应用程序的问题它允许多个用户在相同的浏览器上使用不同的用户ID和密码,同一台计算机上有不同的标签,但gmail,yahoo不允许。 gmail显示所有选项卡中的当前登录用户详细信息。是否有任何解决方案,在浏览器中保留当前用户登录详细信息与asp.net中的不同选项卡。



请给我解决方案。

Hi Friends,
I have problem about my asp.net application it allow multiple user with different user id and password on same browser with different tabs on same computer but gmail,yahoo not allow. gmail shows current login user details in all tabs. is there any solution that keep current user login details in browser with diffrent tabs in asp.net.

please give me solution.

推荐答案

使用Session进行此操作。有关详细信息,请参阅 this
Use Session for this.For further see this


嗨.. GaneshKale22,



登录页面加载时检查会话[UserName]值..如果已经登录浏览器中的某个用户..然后重定向默认页面...



Hi.. GaneshKale22,

While login in page load check the Session["UserName"] value.. if already logged in the some user in the browser.. then redirect default page...

if (Session["LoginUserName"] != null)
            {

                //redirect to default page.. like Homepage..
            }




else{
                Session.RemoveAll();
                Session.Abandon();
            }


谢谢Pravuprasad

根据说明书提供http://blog.startq.com/ 2013/03/28 / prevent-multiple-tabs-on-c-web-applications /它对我有用。



谢谢
Thank you Pravuprasad
As per instruction give in "http://blog.startq.com/2013/03/28/prevent-multiple-tabs-on-c-web-applications/" it work for me.

Thank you


这篇关于如何防止使用不同选项卡在同一个bowser中多次登录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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