Check for cookie support

This shows how to check for cookie support using the browsertype object . Cookies are important on a number of sites for storing user preferences such as log in details , passwords , customizations etc . In this example we display a message but you could redirect to other pages as well if you wished.

Code :

<%
'declare our variables
Dim blnCookies , objBrowser
'create an instance of browsertype object
Set objBrowser = Server.CreateObject("MSWC.BrowserType")
'set blnCookies to either true or false
blnCookies = objBrowser.cookies
'if true the display this message
If blnCookies = True Then
Response.Write "Cookies are supported in this browser"
'if false display this message
Else
Response.Write "Cookies are not supported in this browser"
End If
'destroy the object
Set objBrowser = nothing
%>

 

Sponsors