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

  • Home
  • SEARCH
  • 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 962583
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T01:31:54+00:00 2026-05-16T01:31:54+00:00

I need some help creating the necessary Javascript to add values to an existing

  • 0

I need some help creating the necessary Javascript to add values to an existing cookie. I know how to do it in c#, but it needs to be done in Javascript in this scenario.

This is the C# Code:

HttpCookie myCookie = HttpContext.Current.Request.Cookies["SiteSettings"];
myCookie.Values.Add(varName, varValue);
myCookie.Expires = DateTime.Now.AddYears(1);
HttpContext.Current.Response.Cookies.Add(myCookie);

Can anyone help me convert this to Javascript? I’ve searched high and low on the internet, and most tutorials don’t have a way of specifying the cookie (this site has more than one cookie).

Thank you very much,
Andrew

  • 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-16T01:31:55+00:00Added an answer on May 16, 2026 at 1:31 am

    Not sure where you’ve looked, since the first hit on google for “javascript cookies” is this excellent article by ppk: http://www.quirksmode.org/js/cookies.html

    It should answer your question and explain other JS-related cookie-nuances, including example functions for handling cookies in a more sensible way than string concatenation.

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

Sidebar

Ask A Question

Stats

  • Questions 507k
  • Answers 507k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer It's PHP... http://www.marco.org/55384019 spiteshow: I wonder if the Tumblr guys… May 16, 2026 at 3:54 pm
  • Editorial Team
    Editorial Team added an answer After research on how to write custom converter, here is… May 16, 2026 at 3:54 pm
  • Editorial Team
    Editorial Team added an answer I'm taking a stab at this because without seeing all… May 16, 2026 at 3:54 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I need some help creating this extension method. My view inherits from <%@ Page
Im looking for some help creating a graph using the google chart API I
I have real trouble understanding mod_rewrite, and got some help in creating a RewriteRule
This is probably something simple but it's driving me nuts. I'm making some pagination
I need some help with a query - I'm using Firebird 2.1. I have
I am new to using prepared statements in mysql with php. I need some
I'm in a situation where I need to push image storage for a number
I'm a desktop application developer. I'm creating a basic website from which to sell
At my company we are undertaking a large task of creating a new software
I am creating a table (stats_1) dynamically and would like to have each row

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.