Advertisement
6_2008-2009 Internet/ Browsers/ HTML #200597

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

Shrnutí AI: 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.

Zdrojový kód
original-source
  <%@ Language=VBScript %>
  <%option explicit
  If Len(Request.Cookies("SITESERVER")("ID")) = 0 Then Response.Redirect "BrowserError.asp"
  %>
Původní komentáře (3)
Obnoveno z Wayback Machine