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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T13:44:08+00:00 2026-06-07T13:44:08+00:00

I am setting a value in the cookie using JavaScript and getting the contents

  • 0

I am setting a value in the cookie using JavaScript and getting the contents of the cookie in the code behind.

But the problem is if I am storing the string with some special characters or whitespace characters, when I am retrieving the contents of the cookie the special symbols are getting converted into ASCII equivalent.

For example, if I want to store Adam - (SET) in cookie , its getting converted into Adam%20-%20%28SET%29 and getting stored and when I am retrieving it I get the same Adam%20-%20%28SET%29. But I wan tot get this Adam - (SET) in the code behind.

How I get this. Please help.

  • 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-07T13:44:09+00:00Added an answer on June 7, 2026 at 1:44 pm

    In C#

    Use:

    String decoded = HttpUtility.UrlDecode(EncodedString);
    

    HttpUtility.UrlDecode() is the underlying function used by most of the other alternatives you can use in the .NET Framwework (see below).

    You may want to specify an encoding, if necessary.

    Or:

    String decoded = Uri.UnescapeDataString(s);
    

    See Uri.UnescapeDataString()‘s documentation for some caveats.

    In JavaScript

    var decoded = decodeURIComponent(s);
    

    Before jumping on using unescape as recommended in other questions, read decodeURIComponent vs unescape, what is wrong with unescape? . You may also want to read What is the difference between decodeURIComponent and decodeURI? .

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

Sidebar

Related Questions

My problem is this. I'm setting a cookie using java script, which contains value
I am setting a cookie in my codeigniter application using the following code. Working
Here is my code for setting a cookie: function setCookie(c_name, value, expiredays) { alert(setting
Hello i'm having slight problem when setting one cookie. I am using HttpWebRequest class
I am setting the value of a textbox via javascript client-side. When I refresh
I am using jQuery UI Selectmenu and am having trouble setting the value of
I'm setting the timeout value of an NSMutableURLRequest in code as follows: request.timeoutInterval =
When creating a view and setting group by value some field, it groups only
This my code for setting new cookie Cookie citizen = new Cookie(citizen,email); citizen.setMaxAge(3600); response.addCookie(citizen);
so i have this problem, i'm using a index.inc.php file to set a cookie

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.