我的returnURL在生产中不起作用

问题描述 投票:0回答:1

我在vb.net Web应用程序(.net 4)中使用RedirectFromLoginPage。 它在我的开发环境中可以正常工作,但在我的生产环境中却无法工作。

当我通过dev登录时,我得到以下URL:

http://localhost:63509/Account/Login.aspx?ReturnUrl=%2fDefault.aspx

但是,当我将其推送到生产环境并登录时,会得到以下URL:

http://aaa.aaa.edu/Account/Login.aspx?ReturnUrl=%2f

我的web.config看起来像这样:

    <authentication mode="Forms">
        <forms loginUrl="Account/Login.aspx" timeout="300" defaultUrl="yourView.aspx" />
    </authentication>

我已经验证我的IIS 7 Web服务器上的默认文档是Default.aspx。 我什至在web.config中进行设置以确保。

有什么我可以解决的吗? web.config的授权部分如下所示:

    <authorization>
       <deny users="?" />
    </authorization>

谢谢

c# .net vb.net web-config
1个回答
1
投票

在web.config中,该部分是什么样的? 它的内容如下:

<authorization>
   <deny users="?"/>
</authorization>

或者,这可能是cookie问题。 您是否在任何地方显式设置FormsAuthentication.CookieDomain? 由于您使用的是可能会导致问题的子域。 另外,请尝试清除缓存中的cookie或尝试通过其他浏览器登录以查看是否是cookie问题。

© www.soinside.com 2019 - 2024. All rights reserved.