We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Now you have cookie time only in nr of days, you could enhance that a little.
The old "days" parameter is renamed to "period".. (it defaults back to the original days).
Now the period can be "4d" or "8h" or "1d4h" or "12" for just 12 days
if (typeof period === "number") { period = period.toString()+"d" } if (typeof period === "string") { var addtime=0, t, i, reg = /([0-9]{1,3}[d|h])/g, arr = period.match(reg); for (i=0;i<arr.length;i++) { t=arr[i].slice(-1); switch(t) { case 'h': addtime += (parseInt(arr[i]) * 60 * 60 * 1000) break; case 'd': default: addtime += (parseInt(arr[i]) * 24 * 60 * 60 * 1000) break; } } date.setTime(date.getTime() + addtime); expires = "; expires=" + date.toUTCString(); }
The text was updated successfully, but these errors were encountered:
Using the current code, how do you set values so that a cookie is perennial? Days to -1? Or just some large value?
Sorry, something went wrong.
No branches or pull requests
Now you have cookie time only in nr of days, you could enhance that a little.
The old "days" parameter is renamed to "period".. (it defaults back to the original days).
Now the period can be "4d" or "8h" or "1d4h" or "12" for just 12 days
The text was updated successfully, but these errors were encountered: