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 8326423
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T00:45:23+00:00 2026-06-09T00:45:23+00:00

I use both of these many times in my code and don’t really know

  • 0

I use both of these many times in my code and don’t really know what the difference is , if a cookie is set shouldn’t it be exactly the same in request and response? and is request going to the the most up to date , or response?

EDIT:

ok , I get the difference between a request and a response, but if I type

string a = HttpContext.Current.Request.Cookie["a"].Value;

it is most of the time the same as

string a = HttpContext.Current.Response.Cookie["a"].Value;

but I am wondering what is the difference between using the two.

  • 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-06-09T00:45:25+00:00Added an answer on June 9, 2026 at 12:45 am

    As everyone says Request.Cookies are supposed to be cookies coming from client (browser) and Response.Cookies are cookies that will be send back to client (browser).

    There is black magic well documented* code that copies values from Response cookies to Request.Cookies when you add cookies to Response. As result it looks like you have same cookies in both Request and Response. Note that these copied cookies did not come from the client… so beware of making wrong decisions.

    Here is a link to discussion about the code: http://forums.asp.net/t/1279490.aspx. In particular, cookies added in the following way will show up in the Request.Cookies collection:

    Response.Cookies.Add(HttpCookie("MyCookie", "MyValue"))
    

    *The behavior of cookies getting copied from Response.Cookies is documented in the HttpResponse.Cookies article:

    After you add a cookie by using the HttpResponse.Cookies collection, the cookie is immediately available in the HttpRequest.Cookies collection, even if the response has not been sent to the client.

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

Sidebar

Related Questions

I would like to use both of these library on the same page but
I have an android.graphics.bitmap and an android.net.Uri both of these I can use anyway
Is there a reason why I couldn't use both EF and ADO.NET in my
Are there any sample applications avaliable that make use of both caliburn and prism?
I use both Firebird embedded and Firebird Server, and from time to time I
We use both Examdiff and Kdiff3 to view Mercurial changes. Just add this to
I use both Spring and Spock plugins in my current project. I wrote a
I want to use both bash alias and bash function with several arguments. I
I want to use both ContextLoaderListener (so that I can pass Spring Beans to
I'd like to be able to use both the google-api-client gem to do service

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.