3

我在 www.example.com 上有一个 IIS 网站

以及位于 www.example.com/demo/ 的虚拟目录

如何在我的虚拟目录中使用来自 www.example.com 的身份验证 cookie?

4

3 回答 3

2

You are looking for a Single Site Login solution. If the article I linked to doesn't help you, there's plenty more on google when you know what to search for ;)

于 2009-02-12T14:21:55.117 回答
2

cookie 在同一个域中共享,甚至在应用程序之间共享。我使用相同的 cookie 在 Classic ASP 应用程序和 .net 应用程序之间共享身份验证,没有问题。

只需使用相同的规则来加密或存储 cookie。

于 2009-02-18T12:19:58.513 回答
1

A solution would be to use integrated authentication. This way the user look up, and authentication authority used, will be the same accost all sites with the servers on the same domain. If you are using something like basic or kerberos authentication then your authentication will not pass between sites even on the same server and possibly between parts of the site that run under different threads, eg a different app pool.

Use session data in asp or cookies to share session information on the same site between pages. Cookies will work even if the virtual folders are shared in a different pool. Just code around the requirements of your virtual directory, in case its shared between multiple sites.

P.S. If you are already using cookies, just have the code in your virtual be the same as what you are using on the other pages.

What are the additional requirements for the virtual? Is it on the same server?

于 2009-02-12T14:37:37.060 回答