devnill
devnill

Reputation: 2123

Best practices when using cookies

I'm working on a javascript page using cookies and I was wondering if it is better to use a single cookie which contains multiple values stored in an object or a separate cookie for each value.

Both methods seem to work but is one considered to be a better practice?

Thanks!

Upvotes: 1

Views: 1053

Answers (1)

Jared Farrish
Jared Farrish

Reputation: 49188

No, just use what your project requires. If it makes sense to use one cookie, use one cookie. If not, it's not a problem to use more than one.

Upvotes: 2

Related Questions