function createCookie(name,value,days) { if (days) { var date = new Date(); date.setTime(date.getTime()+(days*24*60*60*1000)); var expires = "; expires="+date.toGMTString(); console.log(expires); } else var expires = ""; document.cookie = name+"="+value+expires+"; path=/"; } function readCookie(name) { var nameEQ = name + "="; var ca = document.cookie.split(";"); for(var i=0;i < ca.length;i++) { var c = ca[i]; while (c.charAt(0)==" ") c = c.substring(1,c.length); if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); } return null; } function eraseCookie(name) { createCookie(name,"",-1); } var cookie_name = "lg_mobile_visited_22"; // Read LG mobile cookie. var visited_cookie = readCookie(cookie_name); if ( visited_cookie == null && 0 == 1 ) { // Set visited LG mobile cookie. createCookie(cookie_name, 1, 1/12); top.window.location.href = "https://library.citadel.edu/mobile/22?fs_redir=1"; }