asp.net Session中时,火狐的两个单独实例之间共享(12) [英] asp.net Session being shared between two separate instances of Firefox (12)

查看:103
本文介绍了asp.net Session中时,火狐的两个单独实例之间共享(12)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我设置一旦用户登录会话变量(会话[loginuser]),并重定向到使用Response.Redirect的另一页。我在Firefox浏览器中的两个单独的实例测试此。使用了两种不同的登录的。登录工作正常,但登录后,如果我点击浏览器窗口1的任何链接,然后点击窗口上的浏览器窗口2,窗口2的其他链接显示的用户名1!

I am setting a session variable once user login (Session["loginuser"]) and redirecting to another page using Response.Redirect. I am testing this in two seperate instance of Firefox browser. Used two different login's. Login works fine, but after login if I click any link on browser window 1 and click the any other link on browser window 2, window 2 is showing username of window 1 !!!

不知道是什么问题..可以有人帮助!

Don't know what is the problem.. can somebody help!

推荐答案

会话都保存在使用cookie每个浏览器的基础。这意味着,当您使用同一台计算机上的相同的浏览器,他们将要共享。这可能会或可能不会是一个问题,因为它不会影响用户,除非能够登录到多个账户在同一台​​计算机上是必要的。

Sessions are kept on a per browser basis using cookies. This means that when you are using the same browser on the same computer they are going to be shared. This may or may not be a problem, as it will not affect users unless being able to log in to multiple accounts on the same computer is necessary.

这artcile会告诉你如何打开cookie的会议,这将解决您的问题:的 http://msdn.microsoft.com/en-us/library/ms972429.aspx

This artcile will tell you about how to turn on cookie-less sessions which will solve your problem: http://msdn.microsoft.com/en-us/library/ms972429.aspx

精华是你应该做的是去你的web.config,并找到看起来像下面的一行,并更改cookie的为真。

Essential what you should do is go to your web.config and find the line that looks like below and change cookieless to true.

<configuration>
  <sessionstate 
  mode="inproc"
  cookieless="true" 
  timeout="20" 
  sqlconnectionstring="data source=127.0.0.1;user id=<user id>;password=<password>"
  server="127.0.0.1" 
  port="42424" 
 />

这篇关于asp.net Session中时,火狐的两个单独实例之间共享(12)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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