Default jQuery method
In my JS (loaded using Require JS) I'm setting a cookie like so:
$.cookie('hideStickyBanner', 1);
This sets a cookie with the expiration date of session which is exactly what I need.
Magento method
But when I try using the mage/cookies
method the expiration date defaults to approx 4 days time.
$.mage.cookies.set('hideStickyBannerMagento', 1);
Question
How can I use the $.mage.cookies.set();
function but have the expiration date be the user's session?
I tried this but the expiration still defaulted to 4 days time:
$.mage.cookies.set('hideStickyBannerMagento', 1, {
expires: 0
});