madu
madu

Reputation: 85

Alternative for document.cookie in JavaScript

Any JavaScript code, other than "document.cookie" to view all the cookies in the browser?

Upvotes: 2

Views: 4045

Answers (1)

m59
m59

Reputation: 43755

document.cookie is for getting/setting cookies - that's what you should use...

There is an alternative for local storage with javascript, which is conveniently called localStorage and sessionStorage.

If you're looking for a library to make it easier to work with document.cookie, perhaps you'd be interested in this: jQuery Cookie (click). Even better, MDN has a little library for working with cookies in these docs (click) (no need for jQuery).

Upvotes: 2

Related Questions