0
我的web應用程序使用表單身份驗證。它工作正常。但是,當我安裝與虛擬目錄相同的應用程序的2個實例時,我可以使用相同的cookie登錄到兩個實例。有沒有辦法將它保存到一個虛擬目錄?使用表單身份驗證限制授權cookie
這是我的web.config。
<authentication mode="Forms">
<forms name="MyAppAuth" loginUrl="~/secured/login" protection="All" timeout="30" slidingExpiration="true" path="/">
<credentials passwordFormat="Clear">>
</credentials>
</forms>
</authentication>
感謝您的路徑提示。我還必須更改cookie在MVC圖層中設置的路徑。 我改變了: FormsAuthentication.SetAuthCookie(userName,rememberMe,「/」); 至 FormsAuthentication.SetAuthCookie(userName,rememberMe); – busbina