Questions tagged [js-cookie]

A simple, lightweight JavaScript API for handling cookies (previously called jquery-cookie)

A simple, lightweight JavaScript API for handling cookies (previously )

Feature Overview

  • Crossbrowser
  • Doesn't rely on any framework
  • Supports ES modules
  • Supports AMD/CommonJS
  • RFC 6265 compliant

Documentation & Links

130 questions
0
votes
0 answers

Javascript cookie adding %5C

I am setting the following as a cookie…
0
votes
1 answer

Storing and returning values in an Array using jQuery Cookies

I'm attempting to create a 'document bank' where the user can save documents and then download as a batch of files. The Cookies seems to be saving the array values, but I'm having trouble figuring out how to return the length of the stored array as…
m918273
  • 110
  • 2
  • 11
0
votes
0 answers

Javascript setinterval with cookie

I have some problem. I have select option with value and keep selected(values) with jscookie, i want to add auto refresh feature to the select option then i choose setInterval to manage it, the jscookies didn't working to keep selected value. here…
0
votes
1 answer

Applying cookies to s with js-cookie

I wish to apply cookies to two inputs' default values. I am using GitHub's jscookie, and it would be preferable to have the answer using jscookie as well. I have an input at a default value of zero and I want it to default to the stored cookie for…
J. Shymko
  • 5
  • 4
0
votes
1 answer

Delete cookie on first of each month

Is it possible to delete a cookie on the first of each month, rather than waiting for the cookie to manually expire? This is so that I can display a message to a user once per month, regardless of how many times they view the site. I am using…
Tom Jones
  • 69
  • 1
  • 8
0
votes
1 answer

Write a cookie based on an URL parameter, then hide or show content based on that cookie

I've searched for the answer to this question and only found half solutions to my issue. I'm trying to write a cookie based on an URL parameter, and then hide or show page content based on if that cookie is present. I'm trying to use js-cookie. If…
0
votes
1 answer

Converting Mootools to Jquery Cookies function

I wrote a while ago a function for removing cookies using mootools. Which worked great. I'm now trying to get it to work in jQuery using the js-cookie libary. I've been trying to get this to work for about 4 hours now and I've now started to bang…
user1616338
  • 557
  • 1
  • 8
  • 24
0
votes
1 answer

How to use js-cookie to remember selected element

I would like the selected element to be remembered by the browser. It's my first time to use js-cookie and I find the documentation very lacking. My inexperience doesn't help either so I decided to ask for some help here. HTML
0
votes
1 answer

Adding Cookie to Age Verification Popup

I am not very experienced in JavaScript or jQuery, but I have created an age verification popup. I need to add cookies to my "yes button" function so the popup doesn't show if a user visits within 7 days. Here is the codepen I have researched enough…
kp_marz
  • 21
  • 1
  • 4
0
votes
0 answers

Using ! with Cookies.get

I'm trying to use js-cookie to hide a cookie bar notice when user clicks ok. The cookie bar has a class of .hide-cookiebar with display: none; so that it doesn't show up briefly when page loads even after the user has clicked ok. Then I want to…
Pete
  • 11
  • 2
  • 6
0
votes
1 answer

Setting cookie expiration with js-cookie

I'm struggling to understand (and set) the expiration for this cookie I'm using on a site to fire a facnybox popup. My goal is to have the cookie set for one minute. Cheers, and thanks in advance for any clarification you could provide.
0
votes
1 answer

Trigger jquery after writing cookie without reloading the page?

How would i go with triggering an alarm or parse it in the html file after writing a js cookie without reloading the page first? I've tried $(window).bind("load", function () but with no success, the alarm still doesn't trigger without reloading the…
ekclone
  • 1,030
  • 2
  • 17
  • 39
0
votes
1 answer

Why am I not able to delete a cookie using Cookie.js?

I'm using Jscookie.js I'm passing down a cookie (on the header) on the response from my server. I can see using cookiemanager+ that the client receives the cookie. My JavaScript attempts to delete the cookie, but the cookie is not being…
ConfusedDeer
  • 3,335
  • 8
  • 44
  • 72
0
votes
3 answers

Store object/array in jQuery Cookie

How can I store an object/array in JavaScript Cookies? I tried that simple code var item = { price: 200, company: 'Microsoft', quantity: 500, code: 'm33' } console.log(item); Cookies.set('item',…
0
votes
1 answer

How do I include a JQuery library on only one page in my Rails app?

I’m using Rails 4.2.3. How do I include a specific Jquery library (jquery-cookie) on only one page in my application? I have this gem in my Gemfile gem 'jquery-cookie-rails' On my “app/views/user_objects/index.html.erb” page, I tried adding this…
Dave
  • 15,639
  • 133
  • 442
  • 830
1 2 3
8
9