asp.net窗体身份验证注销时,登录到另一个实例 [英] asp.net forms authentication logged out when logged into another instance

查看:137
本文介绍了asp.net窗体身份验证注销时,登录到另一个实例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我做的使用VS 2010和运行卡西尼​​我的dev code我的本地机器上的一些发展,我也采取了同样的code的副本,并将其部署到C:\\ MP和设置一个IIS7中的Web应用程序中指向此目录。

I am doing some development on my local machine using VS 2010 and running my dev code in Cassini, I also have taken a copy of the same code and deployed it to c:\mp and setup a web application in IIS7 to point to this directory.

这两个应用程序指向不同的数据库。我访问IIS一个接的http://本地主机/ MP

Both applications are pointing to different databases. I access the IIS one by http://localhost/mp

当我登录到这些它导致我正在从其他登出,如果我已经登录任何一个。

When I log into either one of these it results in my being logged out from the other if I am already logged in.

我有一种感觉,这是什么做的,我们正在使用,并可能覆盖的cookie,但我暂时还没有发现任何有用的窗体身份验证。

I have a feeling this is something to do with the forms authentication we are using and possibly overwriting the cookie but I have not found anything useful yet.

窗体身份验证设置的外观如下:

The forms authentication setup look as follows

<authentication mode="Forms">
    <forms name="MP" loginUrl="~/login.aspx" protection="All" timeout="20" path="/" slidingExpiration="true" cookieless="UseCookies" defaultUrl="~/Modules/Enquirer/Default.aspx" />
</authentication>

我们也使用角色和会员供应商

We are also using roles and the membership providers

 <roleManager enabled="true" cacheRolesInCookie="true" defaultProvider="AspNetSqlRoleProvider">
            <providers>
                <clear />
                <add name="AspNetSqlRoleProvider" connectionStringName="mpconnectionstring" applicationName="mp" type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
            </providers>
        </roleManager>
        <membership defaultProvider="AspNetSqlMembershipProvider" userIsOnlineTimeWindow="20" hashAlgorithmType="SHA1">

我们也使用的是InProc会话状态为虽然我不知道这将是一个问题。

We are also using inProc session state for both although I'm not sure if that would be an issue.

任何人都可以说明为什么发生这种情况,如何解决呢?
                
                    
                    
                
            
            

Can anyone suggest why this is happening and how to get around it?

推荐答案

的问题是与饼干,因为cookie保存记录的确认。

The issue is with the cookie, because the cookie keep the logged confirmation.

更改您的cookie上的web.config可能是解决您的问题的名称。因此,设置在名称根据这两个diferent登录,使用2个不同的cookie的后缀名。

Changing the name of your cookie on web.config is probably solve your issue. So setup the name and the domain according to the two diferent logins, using 2 different cookie suffix names.

<authentication mode="Forms">
 <forms ... name=".CookieSuffix" domain="yoururl.com" ... />
</authentication> 

这篇关于asp.net窗体身份验证注销时,登录到另一个实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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