FormsAuthentication.CookiesSupported Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets a value that indicates whether the application is configured to support cookieless forms authentication.
public:
static property bool CookiesSupported { bool get(); };
public static bool CookiesSupported { get; }
static member CookiesSupported : bool
Public Shared ReadOnly Property CookiesSupported As Boolean
Property Value
false
if the application is configured to support cookieless forms authentication; otherwise, true
.
Examples
The following code example sets the cookieless
attribute to UseUri in the Web.config file. This configuration will result in the CookiesSupported property returning false
.
<authentication mode="Forms">
<forms loginUrl="member_login.aspx"
cookieless="UseUri" />
</authentication>
Remarks
The CookiesSupported property returns a value based on the CookieMode value and the capabilities of the browser.
If the CookieMode property is set to UseCookies, the CookiesSupported property will return
true
.If the CookieMode property is set to UseUri, the CookiesSupported property will return
false
.If the CookieMode property is set to AutoDetect, the CookiesSupported property will return
true
if the browser supports cookies and cookies are enabled; otherwise, the CookiesSupported property will returnfalse
.If the CookieMode property is set to UseDeviceProfile, the CookiesSupported property will return
true
if the Browser for the current Request supports both cookies and redirecting with cookies; otherwise, the CookiesSupported property will returnfalse
.
Applies to
See also
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應