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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T11:52:20+00:00 2026-06-13T11:52:20+00:00

I used multidimensional cookie to store a cookie in my application. For example HttpCookie

  • 0

I used multidimensional cookie to store a cookie in my application.
For example

HttpCookie MyCookie = Request.Cookies["Temp"] as HttpCookie;
                if (MyCookie != null)
                {
                    MyCookie.Values["SID"] = Session.SessionID;
                   MyCookie.Values["NAME"] = "NAME";
                   MyCookie.Values["abc"] = "abc";
                   MyCookie.Values["xyz"] = "xyz";
                   ...
                }

Now to retrieve this multidimensional cookie I used.

string s  = Request.Cookies["Temp"]["SID"]

My question is I want to expire only “SID” value from the “Temp” cookie. I tried with this

Request.Cookies["Temp"]["SID"] = null;

but it’s not working. What should I do clear particular index from multidimensional cookie?

  • 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-13T11:52:21+00:00Added an answer on June 13, 2026 at 11:52 am

    This is already answered in the following question: ASP.NET Cookie Sub-Value Deletion

    HttpCookie.Values is a NameValueCollection, so you can modify that collection – but you will need to re-send the cookie as a new one to overwrite the old one:

    HttpCookie cookie = Request.Cookies["Temp"];
    if(cookie != null)
    {
        cookie.Values.Remove("SID");
        Response.AppendCookie(cookie);
    }
    

    This is also explained in the following MSDN page: http://msdn.microsoft.com/en-us/library/aa289495(v=vs.71).aspx#vbtchaspnetcookies101anchor9

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

Sidebar

Related Questions

I used Session[EmpName] = Convert.ToString(Request.QueryString[1]); lblEmployeeName.Text = Session[EmpName].ToString; to show the data in label
I have many large multidimensional NP arrays (2D and 3D) used in an algorithm.
I have used KD-tree(libkdtree++) to store a multi-dimensional data set, and the requirements here
In my application there is a multidimensional array with potentially a lot of data
I have a global multidimensional array, g_iAllData[MAX_LEN][MAX_WIDTH] being used in a Form. When I
I have gathered data with jQuery, putten it into a multidimensional array, used JSON.stringify
I am submitted a getJSON request to a controller in my application, this controller
How to search value in multidimensional array, for example I want to search example
Used to be quite happy with the Ctrl + Shift + F10 shortcut in
Used code I found on SO to use the COM based Acrobat Reader to

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.