How to configure session state to UseDeviceProfile in ASP.NET

Software developer can configure session state through web.config file for his current application (which is found in the same virtual directory as the .aspx web page files).  UseDeviceProfile is the one of possible modes for HttpCookieMode. When this mode is set ASP.NET chooses to use cookieless sessions by examining the BrowserCapabilities object. The drawback is that this object indicates what the device should support – it doesn’t take into account that the user may have disabled cookies in a browser that support them.

<?xml version=”1.0” encoding=”utf-8” ?>
     <!— other settings are omitted. —>
        cookieless=”UseDeviceProfile” cookieName=”ASP.NET_SessionID”
        sqlConnectionString=”data source=;Integrated Security=SSPI”
        sqlCommandTimeout=”30” allowCustomSqlDatabase=”false”