Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4041428
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T12:52:45+00:00 2026-05-20T12:52:45+00:00

I have a doubt, I will appreciate if you can clear it . COOKIES

  • 0

I have a doubt, I will appreciate if you can clear it .

COOKIES

What are cookies? When described as entities, which is how cookies are often referenced
in conversation, you can be easily misled. Cookies are actually just an extension of the
HTTP protocol. Specifically, there are two additional HTTP headers: Set-Cookie and
Cookie.The operation of these cookies is best described by the following series of
events:

  1. Client sends an HTTP request to server.

  2. Server sends an HTTP response with Set-Cookie: foo=bar to client.

  3. Client sends an HTTP request with Cookie: foo=bar to server.

  4. Server sends an HTTP response to client.

Thus, the typical scenario involves two complete HTTP transactions. In step 2, the server
is asking the client to return a particular cookie in future requests. In step 3, if the
user’s preferences are set to allow cookies, and if the cookie is valid for this particular
request, the browser requests the resource again but includes the cookie.

Now my question is…….

why you cannot determine whether a user’s preferences are set to allow cookies during the first request????

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T12:52:46+00:00Added an answer on May 20, 2026 at 12:52 pm

    The other answer is already correct, steps 3 & 4 will not occur without something to “trigger” them. When detecting whether the user has cookies enabled or not, that’s usually done with a HTTP redirect, or possibly with some Javascript (if you also want to detect that they have Javascript enabled, for example).

    The first request is to ask the client to set the cookie, the second request is to check that the client actually did what you asked it to do.

    The reason you can’t detect whether cookies are enabled without a second request is because many clients will, when they see the “Set-Cookie” header, prompt the user to see whether they want to accept it or not. So it would be impossible for the client to include a special “I accept cookies” or “I do not accept” header in the initial request, because it simply doesn’t know the answer until you actually present it with a cookie.

    There are many parallels with this kind of process:

    1. To check whether you have access to a file on the file system, you need to attempt to open the file.
    2. To check whether the user has Javascript turned on, you have to actually attempt to run some Javascript.
    3. To determine the compressed size of a file, you have to actually compress it.

    And so on. So to check whether the user allows cookies, you have to actually try to set one.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have a doubt in sessionid. when user visit the site one sessionid will
I have a doubt about which is better from performance point of view. I
I have a doubt from a silverlight application we can access MyDocuments. I am
I have doubt with android backstack , please consider the scenario I have two
I have doubt when i am reading difference resource for Proxy fetching or No-proxy
I am reading linux device driver book of rubini,corbet and hartmen.I have doubt regarding
Possible Duplicate: What is the difference between const and readonly? i have doubt in
I have some doubt on below code #include<stdio.h> int i=6; int main() { int
I have no doubt this has been asked and answered here a dozen times,
I have a doubt, when we try to register for C2DM, does the registration

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.