Advertisement
2_2002-2004 Internet/ Browsers/ HTML #128738

Detect if Cookies are Enabled with 1 (that's one!) line of code

In looking for an easy way to detect the client browser's cookie settings, everything I've found has been complex. Each example I've found requires a page refresh or redirect to itself. This severely hampers true application development as the Request.Form collection is then cleared. This code is something simple I stumbled on and it works (see explanations).

AI

AI Summary: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Source Code
original-source
  <%@ Language=VBScript %>
  <%option explicit
  If Len(Request.Cookies("SITESERVER")("ID")) = 0 Then Response.Redirect "BrowserError.asp"
  %>
Original Comments (3)
Recovered from Wayback Machine