Re: How to determine if a browser is cookie-enabled?

From: Igor Tandetnik (itandetnik_at_mvps.org)
Date: 06/24/04


Date: Thu, 24 Jun 2004 15:18:58 -0400


"Bart S." <Bart S.@discussions.microsoft.com> wrote in message
news:3BB6C569-C6B7-47EF-9AEC-31E20CC3CB22@microsoft.com
> My problem is that I am trying to program an e-commerce web crawler.
> On some sites, I receive a ''browser not cookie enabled" page on the
> very first request/response. This leads me to believe that I need to
> stick a 'cookie' entry into the initial request so that the site can
> determine that the crawler is able to handle cookies.

This is unlikely - I don't quite understand a site that would reject a
first-time visitor. How would you ever get an original cookie set if the
site turns you away immediately?

What is more likely is that the first page you hit involves a redirect,
where redirecting response sets a cookie and the page you are redirected
to expects to see this cookie. Are you maintaining cookie cache
correctly?

Alternatively, you are trying to navigate to a page that was not meant
to be reached directly, but only via link from some other page. That
other page sets the cookie, and the page you are trying to reach reads
it. Pretty stupid, as it limits the user's ability to bookmark the site,
but possible.

> Is this correct? Is there a generic entry a cookie enabled browser
> sticks in the request header on the initial request to show that it
> is cookie enabled?

None that I know of.

> I have poured over the http/1.1 standard and I can't find either the
> 'Cookie' or 'Set-Cookie' header entries anywhere. Is there somewhere
> else I should look?

That would be RFC2109, obsoleted by RFC2965 (but most implementations
still conform to RFC2109 AFAIK)

http://www.faqs.org/rfcs/rfc2109.html
http://www.faqs.org/rfcs/rfc2965.html

-- 
With best wishes,
    Igor Tandetnik
"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken


Relevant Pages

  • RE: HTTPModule - an interceptor indeed, but without communication skills!
    ... httpModule to check in the certain event before request has been processed ... easily manually append such querystring to bypass the validation. ... My suggestion is what about the cookie? ... In the validation code, you can use javascript ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Printing website - cookies
    ... would be requested with the Print command so that the latest version of any ... gets that cookie). ... At the request of any "private" article or image, ... All "private" images in the article turn out, on paper, as the default ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: Problem with Forms Authentication cookies
    ... > only 2, the ASP.NET_SessionID cookie and the Forms Authentication cookie, ... > The next request coming is is a GET request for the Forms Authentication ... > In looking at the logs for NORMAL expired authentication redirects these ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: User.IsInRole not redirecting
    ... Dim hash As String = FormsAuthentication.Encrypt ... Dim cookie As New HttpCookie ... Sub Application_AuthenticateRequest(ByVal sender As Object, ... Each request that comes in (via the ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Request Cookies right after theyre being Set
    ... > the response object is updated. ... BUT NOT the request object. ... ' Creates a new cookie "test" with value DateTime.Now ...
    (microsoft.public.dotnet.framework.aspnet)