Timeline for Magento 2: How to use Cookie?
Current License: CC BY-SA 3.0
10 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Oct 12, 2018 at 8:37 | comment | added | Chirag Patel | How to get cookie in another page? | |
Oct 20, 2017 at 7:13 | comment | added | Key Shang |
OK, find the error solution, we need change define to require in the codes.
|
|
Oct 20, 2017 at 7:07 | comment | added | Key Shang |
In Magento 2.1.8, it shows Uncaught Error: Mismatched anonymous define() module: function ($) { $.cookie('cookiename', '123'); }
|
|
Oct 3, 2017 at 13:19 | comment | added | Rakesh Jesadiya | i havent try with $.mage.cookies.set() yet. | |
Oct 3, 2017 at 13:16 | comment | added | Ben Crook |
Turns out it expires with the user's session by default which is what I needed. Related question, is there any difference between $.cookie() and $.mage.cookies.set() ?
|
|
Oct 3, 2017 at 12:59 | comment | added | Rakesh Jesadiya | @BenCrook, $.cookie('foo', '', {path: '/', expires: -1}); is not working for you? | |
Oct 3, 2017 at 12:58 | comment | added | Ben Crook | Any idea how to set an expiration date using this method @RakeshJesadiya? | |
Mar 8, 2017 at 9:05 | comment | added | Rakesh Jesadiya | @AnkitShah mage/cookies is also working in magento 2. | |
Mar 8, 2017 at 7:29 | comment | added | Jackson |
mage/cookies is for Magento 1?
|
|
Mar 8, 2017 at 7:28 | history | answered | Rakesh Jesadiya | CC BY-SA 3.0 |