function setCookie(key, value, expiry) {
var expires = new Date();
expires.setTime(expires.getTime() + (expiry * 24 * 60 * 60 * 1000));
document.cookie = key + '=' + value + ';expires=' + expires.toUTCString();
}
function getCookie(key) {
var keyValue = document.cookie.match('(^|;) ?' + key + '=([^;]*)(;|$)');
return keyValue ? keyValue[2] : null;
}
function eraseCookie(key) {
var keyValue = getCookie(key);
setCookie(key, keyValue, '-1');
}
jQuery(document).on('click', '#mycookiebtn', function(event){
setCookie('test','1','1'); // key,value,expiry in days
});
var mycookier = getCookie('test');
// if ( mycookier == true ) {
// window.location = "http://healthsurance.bklstaging.com/hospital-patient/";
// }
This code needs to put different template as cookie available hole site.
if ( mycookier == true ) {
window.location = "http://healthsurance.bklstaging.com/hospital-patient/"; }