get cookie in javascript
function getCookie(cookie, name) {
const q = {}
cookie?.replace(/s/g, '')
.split(';')
.map(i=>i.split('='))
.forEach(([key, value]) => {
q[key] = value
})
return q[name]??null;
}
get cookie in javascript
function getCookie(cookie, name) {
const q = {}
cookie?.replace(/s/g, '')
.split(';')
.map(i=>i.split('='))
.forEach(([key, value]) => {
q[key] = value
})
return q[name]??null;
}
document cookies javascript
cookieData=document.cookie.split("; ");
for(let i=0; i<cookieData.length; i++){
cookieData[i]=cookieData[i].split("=");
cookieName=cookieData[i][0];
cookieValue=cookieData[i][1];
//write your cookie name which you want to see in the place of 'mobNo'
if(cookieName==='mobNo'){
console.log(cookieData[i]);
}
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us