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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T11:08:28+00:00 2026-05-20T11:08:28+00:00

When calling Response.Cookie.Add(new HttpCookie(MyCookie, objValue)); where does the cookie saved? on Client Machine or

  • 0

When calling Response.Cookie.Add(new HttpCookie("MyCookie", "objValue")); where does the cookie saved? on Client Machine or Server Machine?

EDIT:
if saved in Client Machine, how can I read it from javascript then? I tried this kind of script.

function getCookie(c_name) {
    var i, x, y, ARRcookies = document.cookie.split(";");
    for (i = 0; i < ARRcookies.length; i++) {
        x = ARRcookies[i].substr(0, ARRcookies[i].indexOf("="));
        y = ARRcookies[i].substr(ARRcookies[i].indexOf("=") + 1);
        x = x.replace(/^\s+|\s+$/g, "");
        if (x == c_name) {
            return unescape(y);
        }
     }
}

I cannot get the cookie that I saved from code behind. When I look into the document.cookie object, it is just an empty string.

Scenario:

  1. On Page_Init() on code behind. I create a cookie using Response.Cookie.Add(new HttpCookie("MyCookie", "cookieValue"));.
  2. On Client side, I’m trying to read the cookie saved from code behind on page load using the snippet above, but it returns undefined
  • 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-20T11:08:29+00:00Added an answer on May 20, 2026 at 11:08 am

    As Wikipedia explains, cookies string values that are stored on the client.
    They are sent to server with each HTTP request as Cookie: headers.

    You can store arbitrary objects in the server using session state.

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

Sidebar

Related Questions

Can I simply set the Transfer-Encoding header? Will calling Response.Flush() at some point cause
When calling the AJAX call, the call request and response can see on console
I'm calling a services API, and it returns a response object, how can I
I am new to Resteasy, I am calling a service and getting the response
While calling from my Web Application, WCF response i am getting is : <s:Envelope
The extension methods: Response.AsJson Response.AsXml works fine when calling it from the constractor like:
I'm going nuts over this. I can write to a cookie, and then read
Is calling HttpServletResponse.addCookie(); (from servlet-api-2.5) multiple times using a cookie with the same name
In ASP.net 2.0 Response.Cookies.Add() is a VOID (which boggles me somewhat). Is there a
I was under the impression that not calling Response.Flush would ensure that Connection: Close

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.