yckart / jquery.storage.js

The client-side storage for every browser, on any device.
http://yckart.github.com/jquery.storage.js/
49 stars 12 forks source link

Local Storage Cookie Issue #4

Open mzahidriaz opened 10 years ago

mzahidriaz commented 10 years ago
$.localStorage.options = {
    cookiePrefix : 'fallback:' + method + ':',
    cookieOptions : {
        path : '/',
        domain : document.domain,
        expires : ('localStorage' === method) ? { expires: 365 } : undefined
    }
};

This fails on my andriod 2.3.5. Because expires gone twice in the cookie options object.

Therefore I've to change it to just number to work.

var defaults = {
        cookiePrefix : 'fallback:' + method + ':',
        cookieOptions : {
            path : '/',
        domain : document.domain,
        expires : ('localStorage' === method) ? 365 : undefined
    }
};
mzahidriaz commented 10 years ago

Its a bug. How it is invalid. You can't pass object in expires attribute of cookie option. Thats what jquery.cookie.js says