Created
February 25, 2014 04:59
-
-
Save khacanh/9202985 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function createCookie(value) { | |
var name = 'sessionid'; | |
var days = 3; | |
if (days) { | |
var date = new Date(); | |
date.setTime(date.getTime()+(days*24*60*60*1000)); | |
var expires = "; expires="+date.toGMTString(); | |
} | |
else var expires = ""; | |
document.cookie = name+"="+value+expires+";"; | |
window.location = '/'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment