How does ASP.Net Cookieless work ?

这一生的挚爱 提交于 2019-12-29 07:42:01

问题


I try to set the <sessionstate /> in my web.config but I don't know what are they. I would like to know about ASP.Net <SessionState cookieless="" />.

<sessionState cookieless="*****"> 
  1. AutoDetect
  2. UseCookies
  3. UseDeviceProfile
  4. UseUri
  5. true
  6. false

Let me know with short note.


回答1:


Specifies how cookies are used for a Web application.

The cookieless attribute can be one of the following possible values. The default is the UseCookies value.

Note When you configure an AJAX-enabled ASP.NET Web site, use only the default value of UseCookies for the cookieless attribute. Settings that use cookies encoded in the URL are not supported by the ASP.NET AJAX client script libraries.

Value Description

AutoDetect ASP.NET determines whether the requesting browser or device supports cookies. If the requesting browser or device supports cookies, AutoDetect uses cookies to persist user data; otherwise, an identifier is used in the query string. If the browser or device supports cookies, but cookies are currently disabled, cookies are still used by the requesting feature.

UseCookies Cookies persist user data, regardless of whether the browser or device supports cookies.

UseDeviceProfile ASP.NET determines whether to use cookies based on the HttpBrowserCapabilities setting. If the HttpBrowserCapabilities setting indicates that the browser or device supports cookies, cookies are used; otherwise, an identifier is used in the query string.

UseUri The calling feature uses the query string to store an identifier, regardless of whether the browser or device supports cookies.

have also a look at http://msdn.microsoft.com/en-us/library/h6bb9cz9.aspx




回答2:


Note When you configure an AJAX-enabled ASP.NET Web site, use only the default value of UseCookies for the cookieless attribute. Settings that use cookies encoded in the URL are not supported by the ASP.NET AJAX client script libraries.

Well i'm using ASP.Net Ajax in Combination with <sessionState cookieless="true"> and never experienced any problems... I'm Using an Updatepanel as well as an ASP Accordion on different pages.



来源:https://stackoverflow.com/questions/5027653/how-does-asp-net-cookieless-work

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!