With a revised question, new answer:
The HttpBrowserCapabilitiesBase.Cookies documentation HttpBrowserCapabilitiesBase.Cookies says:
This property does not indicate whether cookies are enabled in the browser only if the browser supports cookies.
It seems to be installed based on user browser discovery and a database of browser capabilities on the server. Thus, it will tell you with confidence whether the browser can store cookies if and only if:
- The query user agent string is correct.
- The browser is in the database and the database is correct for the browser.
Condition No. 1 will be broken if the header of the user's HTTP agent has been changed (for example, by developer tools or a proxy server). Condition No. 2 will be violated if the browser is newer than the database, or if there is a defect in the database.
tl; dr version: there is no guarantee, consider this information as "best effort." And, of course, the user could turn off cookies (for example, in "private" viewing mode).
Original answer to another question:
If you want to rely on cookies that you send in response, you always return in the same way, then the answer is: usually, but do not rely on it.
Possible reasons:
- Non-HTTP cookies can be modified by the client side of the script (and that the script can be entered locally).
- Browser Error.
- Use a non-browser for the request (e.g.
wget.exe ) that does not process cookies for the user. - A proxy server that modifies a request or response.
- The local clock on the client system, changed to turn off the cookie.
- User modifies browser cookie storage.
source share