UNPKG

is-cookie-http-only

Version:

Checks whether cookie is HTTP only

15 lines (11 loc) 271 B
import Cookies from 'js-cookie'; export default function(cookieName) { const value = Cookies.get(cookieName); if (value) { return false; } Cookies.set(cookieName, 'test'); const test = Cookies.get('test'); Cookies.remove(cookieName); return !test; }