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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T07:25:40+00:00 2026-06-13T07:25:40+00:00

I want to create a cookie with: Name: drm Value: drmStatus=Expected I’m using the

  • 0

I want to create a cookie with:

  • Name: drm
  • Value: drmStatus=Expected

I’m using the code from the answer to this question – Jquery Cookie plugin – multiple values? to create the cookie

 var obj = { drmStatus: 'Expected' }; 
 $.cookie('drm', $.param(obj), { path: '/', raw: true })

However this generates a cookie with

  • Name: drm
  • Value: drmStatus%3DExpected

The reason for this is this snippet from https://github.com/carhartl/jquery-cookie/blob/master/jquery.cookie.js

config.raw ? value : encodeURIComponent(value)

This is using the value of “raw” from the config object to decide whether to encode the value. It appears to be ignoring the value of “raw” value passed in the options object.

So my question is, can I set the option raw: true when using jquery.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-13T07:25:41+00:00Added an answer on June 13, 2026 at 7:25 am

    I think your problem is not in the jquery.cookie but in the $.param part of your script. See this JSFiddle. The raw option is set correctly and the cookie has your desired value.

    This should work:

    var obj = { drmStatus: 'Expected' }; 
    $.cookie('drm', decodeURIComponent($.param(obj)), { path: '/', raw: true })
    

    EDIT: I updated the Fiddle to work with your new version. The solution is:

    var obj = { drmStatus: 'Expected' }; 
    $.cookie.raw = true;
    $.cookie('drm', $.param(obj), { path: '/' });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to create a cookie using php,an also i need to read it
i want create Dynamic Slideshow in Jquery i'm Write this code var ctx =
I'm using a PHP/MySQL Login Code, and I want it to store the cookie
i want create multiple search where statement $where_search is a multiple condition from post
i want create a custom json data from the mssql 2008 results so that
I want to: Check to see if a cookie with name of query exists
I know how to write/create cookies in JavaScript......................................................... //Create the cookies document.cookie = Name=
I have a problem with cookies in MVC3. I want to create a cookie,
php manual has setcookies syntax like this setcookie ($name, $value, $expire, $path, $domain, $secure,
I have java script, i used it for create cookie and i want 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.