UNPKG
is-cookie-http-only
Version:
latest (0.1.0)
0.1.0
Checks whether cookie is HTTP only
is-cookie-http-only
/
main.js
15 lines
(11 loc)
•
271 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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; }