Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function setCookie(cookieName, value, daysToExpire, path, domain, secure) {
- var expiryDate;
- if (daysToExpire) {
- expiryDate = new Date();
- expiryDate.setTime(expiryDate.getTime() + (daysToExpire * 8.64e7));
- }
- document.cookie = cookieName + '=' + (value.toString()) +
- (daysToExpire ? ';expires=' + expiryDate.toGMTString() : '') +
- ';path=' + (path ? path : '/') +
- (domain ? ';domain=' + domain : '') +
- (secure ? ';secure' : '');
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement