在我们的 asp.net 应用程序中,我们有几个虚拟目录。在 IIS7 中,这些被称为“应用程序”,它们都具有相同的应用程序池,以经典管道模式运行。
- www.webapp.com/example1
- www.webapp.com/example2
- 等。
它们都指向同一个物理目录,例如 C:\webapp。唯一的区别是它们都有一个底层虚拟目录,指向不同的 CSS 文件夹,该文件夹位于 C:\webapp\styles\ (例如 C:\webapp\styles\example1\base.css 等),
我们使用表单身份验证和内置成员资格提供程序。我们遇到的问题是:
当用户浏览 www.webapp.com/example1/page.aspx 并单击重定向到 www.webapp.com/example2/otherpage.aspx 的链接时,用户会被重定向到 www .webapp.com/example2/login.aspx。会话似乎已过期。
我们真的不知道在哪里寻找解决方案,非常感谢任何指点!
提前致谢!
斯泰因
in our asp.net app, we have several virtual directories. In IIS7, these are called "applications" and they all have the same application pool, running in classic pipeline mode.
- www.webapp.com/example1
- www.webapp.com/example2
- etc.
They all point to the same physical directory, say C:\webapp. The only difference is they each have an underlying virtual dir that points to a different CSS folder, which is located in C:\webapp\styles\ (eg. C:\webapp\styles\example1\base.css, etc)
We use forms authentication and the built-in membership provider. The problem we have is this:
When a user is browsing www.webapp.com/example1/page.aspx and clicks on a link that redirects to www.webapp.com/example2/otherpage.aspx,the user is instead redirected to www.webapp.com/example2/login.aspx. It seems as if the session expired.
We don't really know where to look for a solution, any pointers are greatly appreciated!
Thanks in advance!
Stijn
发布评论
评论(1)
我们找到了解决方案,所以我想我应该与 SO 社区分享:
通过反射将 AppDomainAppId 设置为固定值(在本例中为 applicationName):
Globals.asax.cs:
We found the solution so I thought I'd share this with the SO community:
set AppDomainAppId to a fixed value (in this case applicationName) through reflection:
Globals.asax.cs: