【发布时间】:2020-02-11 14:37:39
【问题描述】:
当我需要将 cookie 从一个本地应用程序共享到另一个应用程序时,我遇到了这种情况。我想知道是否可以通过使应用程序的地址之一 localhost:number 成为另一个 localhost 的子域来实现它?
提前致谢。
【问题讨论】:
-
在
C:\Windows\System32\drivers\etc\hosts文件中定义不同的域和子域。 -
如果您在 IIS 中托管应用程序,您可以进行 URL 重写:weblogs.asp.net/owscott/…
-
您也可以使用通配符在主机中指定
127.0.0.1 *.localhost.com
标签: c# asp.net asp.net-mvc asp.net-core asp.net-web-api