DEV Community

Cover image for A practical, Complete Tutorial on HTTP cookies

A practical, Complete Tutorial on HTTP cookies

Valentino Gagliardi on September 16, 2020

What are cookies in web development? Cookies are tiny pieces of data that the backend can store in the user's browsers. User tracking, p...
Collapse
 
hohonsing profile image
Ho Honsing

Thanks for the detailed writings!
I have one question though: Where can we store the JWT refresh token other than localStorage & cookies, so that the user still have that piece of token after a refresh/hard reload?

Collapse
 
valentinogagliardi profile image
Valentino Gagliardi

That's a good question. I'll write something on this topic sooner or later!

Collapse
 
hohonsing profile image
Ho Honsing

Good to hear. Looking forward to another great content from you!

Collapse
 
guilima profile image
Guilherme Carvalho Lima • Edited

Is it possible to play with sameSite none and secure cookies between client and server side both locally? I'm having problem probably because of trusted and signed credentials for https protocols. Do you know any article about that?

Hey nice article. You wrapped up all information about the cookies pretty well. Thanks

Collapse
 
salothom profile image
Sarah Thompson

This is great, very nicely organized! Thanks!

Collapse
 
valentinogagliardi profile image
Valentino Gagliardi

You're welcome!

Collapse
 
julianjupiter profile image
Julian Jupiter

So timely, I am learning authentication in ReactJS and I am using both Cookie and localStorage. I'll keep this under my pillow. Thanks for this.

Collapse
 
valentinogagliardi profile image
Valentino Gagliardi

You're welcome!

Collapse
 
rakeshyadavs9 profile image
Rakesh Yadav

Thanks for sharing 😊

Collapse
 
valentinogagliardi profile image
Valentino Gagliardi

you're welcome!

Collapse
 
caketi profile image
zhao

great article

Collapse
 
dozykeys profile image
Duru Chidozie

Great discussion..Very apt

Collapse
 
qq449245884 profile image
qq449245884

Hello, may I translate your article into Chinese?I would like to share it with more developers in China. I will give the original author and original source.

Collapse
 
valentinogagliardi profile image
Valentino Gagliardi

Sure, just reference the original post valentinog.com/blog/cookies/

Collapse
 
nitinrajyadav profile image
Nitin Raj Yadav

I've been looking for some good resources on HTTP Cookies, and this's the best explanation I found so far; thank you very much @valentinogagliardi .

Collapse
 
valentinogagliardi profile image
Valentino Gagliardi

You're welcome!