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;
}
how to set cookies in node js
res.cookie('cokkieName',randomNumber, { maxAge: 900000, httpOnly: true })
res.cookie('Cookie Name', 'Cookie Value', {Cookie Options Object})
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