How do server side authentication sessions work (express & cookies)

  Рет қаралды 36,947

Web Dev Cody

Web Dev Cody

Күн бұрын

A walkthrough on how server side authentication sessions work using cookies.
------------
🔔 Newsletter eepurl.com/hnderP
💬 Discord / discord
📁. GitHub github.com/cod...

Пікірлер: 50
@aissa.bouguern
@aissa.bouguern Жыл бұрын
I really like how you explained sessions without relying on "express-session" or any third-party library that abstracts the work done behind the scenes. This helps beginners to adopt a nice and very simple mental model about what sessions are about. Thank you so much!
@SkySentry7
@SkySentry7 4 ай бұрын
TYSM man. I've been struggling trying to understand how sessions work with cookies
@Goofy8907
@Goofy8907 5 ай бұрын
DUDE, this is how you explain something Very well done, I just came from another video on the same topic, watched the whole thing and was still clueless. Watched your video for like 3 minutes and had most of my questions answered, kept watching because of how well you explained. Thank you, I'm subscribing.
@mossabDiae
@mossabDiae Ай бұрын
Cody, that was beautifully explained. The note you added at the end about why JWT would be useful is a gem. Subscribed.
@JoelGrayson
@JoelGrayson Жыл бұрын
Thank you for the simple explanation. Helped me a lot. Tip: res.clearCookie() does the same thing as res.set('Set-Cookie', `session=null`)
@bitsplode
@bitsplode Жыл бұрын
whats the difference? Number one wipes the cookie out of existance and number 2 just null-ifies it???
@jperusm
@jperusm 7 ай бұрын
@@bitsplode that is correct. number two will just "modify" the cookie value but will not delete it.
@devnarula6733
@devnarula6733 5 ай бұрын
exactly what I was looking for, appreciate such low level bare-bone session auth for understanding instead of just using some plugin which teaches no one anything!
@ChangaSingh-y4n
@ChangaSingh-y4n 9 ай бұрын
appreciate dumming down the complex concept
@cristianadejola464
@cristianadejola464 Жыл бұрын
Currently working same subject but with SQL database. Bit complicated and stressful. But your tutorial help a lot. Thanks ones again
@HassanChakkour
@HassanChakkour Жыл бұрын
You sir deserve all the support, thank you so much, you pretty much saved me time. Great work
@kosidinna_
@kosidinna_ 5 ай бұрын
i know i'm late to this but as someone who is just getting round to backend stuff, this was very useful. Thank you
@marksheard1210
@marksheard1210 8 ай бұрын
Awesome stuff, Thank you Cody!!! I have been using passport-local and figuring my way round. I highly recommend going through THIS BASIC overview before leaning on other modules\packages like passport-local and express-session.
@meepk633
@meepk633 Жыл бұрын
I learned today that you can use the 'public' and 'private' keywords in TypeScript constructor parameters to auto-assign them. You don't even need to list them as members. It just adds them to the instance automatically. This is completely unrelated btw. Just wanted to share.
@digvijaysingh6882
@digvijaysingh6882 Жыл бұрын
simple and thorough. Glad you didn't use all those fancy abstractions.
@mayor3367
@mayor3367 2 жыл бұрын
Thank you so much. I had a hard time understanding how jwt does what it does. It is so much clearer now.
@raprincis
@raprincis 8 ай бұрын
Simple, helpful, and very instructive
@bentheafrican
@bentheafrican 2 жыл бұрын
Nice tutorial Looking forward to watch the next one.
@CoryTheSimmons
@CoryTheSimmons 7 ай бұрын
Best tutorial I've ever seen.
@GilP-BM
@GilP-BM 6 ай бұрын
Love your content & input, thanks Cody!
@offgridvince
@offgridvince 8 ай бұрын
Great video! Thx
@mferino1960
@mferino1960 Жыл бұрын
Great video, thanks so much! I am about to build something using remix-auth (which is my first ever auth implementation) and wasn't clear on the cookie / session relationship. Most of the things I found just by browsing the web were like, the session is stored on the server and the cookie is stored on the client... thanks, that helps me not at all. This video cleared it all up and I now have a working mental model.
@aiknowledge-n2s
@aiknowledge-n2s 2 жыл бұрын
Simply put together
@exe.m1dn1ght
@exe.m1dn1ght Жыл бұрын
I love this explanation ! thanks Cody !
@SeibertSwirl
@SeibertSwirl 2 жыл бұрын
Great job babe!!! You’re killin this!
@cristianadejola464
@cristianadejola464 Жыл бұрын
just subscribe to your channel. you are really helping the junior Dev. Thanks so much
@alexvolkov529
@alexvolkov529 Жыл бұрын
Hi! Thank you for your video! I have a question how I can store sessionId on my frontend in production?Just using the domain attribute does not work since I'm using a free hosting wich is the Public Suffix List and after all frontend and backend are hosted on different subdomains. Should I store sessionId on the front-side? Or is it not the case?
@lightsinvalues9856
@lightsinvalues9856 2 жыл бұрын
thank you very much
@AnonymousPumpkin616
@AnonymousPumpkin616 2 ай бұрын
can u provide the code?
@codinginflow
@codinginflow Жыл бұрын
Can you tell me what's this VS Code theme? It's beautiful
@WebDevCody
@WebDevCody Жыл бұрын
I think this is material community high contrast
@codinginflow
@codinginflow Жыл бұрын
@@WebDevCody Thank you
@blackpeep984
@blackpeep984 Жыл бұрын
shades of purple
@codinginflow
@codinginflow Жыл бұрын
@@blackpeep984 That's what I thought actually
@blackpeep984
@blackpeep984 Жыл бұрын
@@codinginflow it's my personal favorite so i knew right away what theme he's using
@alexdonoaga89
@alexdonoaga89 Жыл бұрын
whats the extension name for copilot that you used to recive the delete cookie thing ?
@tljstewart
@tljstewart 11 ай бұрын
Great content
@ponderatulify
@ponderatulify 2 жыл бұрын
How do you go about storing the session? Removing the session? How does it scale?
@tudor14
@tudor14 Жыл бұрын
You could store the session in Redis and other user info too (but the session ID is only sent back in cookie). Removing the session you'd just find the session based on sessionId in your store/database and delete it.. And for scaling well lets just say you're on your own there...
@captainalpha4853
@captainalpha4853 Жыл бұрын
Hello, I'm using express-session package. When i log in, i see that there is a cookie in the response. However, when i try to make a new request to the server, I don't see the cookie in the request header. PS: I'm using Nuxt3 for client side.
@WebDevCody
@WebDevCody Жыл бұрын
If you’re using axios or fetch you usually have to specify withCredentials true for all your requests
@sjfieksnd
@sjfieksnd Жыл бұрын
Cool!
@velara314
@velara314 Жыл бұрын
If I need to authenticate across two different domains should I use Jwt or sessions?
@WebDevCody
@WebDevCody Жыл бұрын
I think jwt might be easier. sessions usually use cookies which often suggest same-site policies. I'd have to research this question to be honest., but google single sign on approaches
@notfadeaway6617
@notfadeaway6617 Жыл бұрын
nice video
@bamideleprecious3481
@bamideleprecious3481 Жыл бұрын
What plugin can I use
@WebDevCody
@WebDevCody Жыл бұрын
Material community
@brianpolly-ei3nk
@brianpolly-ei3nk 9 ай бұрын
Are you on telegram
@ashajanet12-a92
@ashajanet12-a92 4 ай бұрын
This is wayy good explanation!🫴✨
Incredible: Teacher builds airplane to teach kids behavior! #shorts
00:32
Fabiosa Stories
Рет қаралды 11 МЛН
Офицер, я всё объясню
01:00
История одного вокалиста
Рет қаралды 5 МЛН
Learn JWT in 10 Minutes with Express, Node, and Cookie Parser
10:20
Web Dev Cody
Рет қаралды 112 М.
Session Vs JWT: The Differences You May Not Know!
7:00
ByteByteGo
Рет қаралды 174 М.
Why I'd never host my apps on a VPS
13:43
Web Dev Cody
Рет қаралды 58 М.
Oh, Auth Doesn't Have to Suck?
7:16
Josh tried coding
Рет қаралды 64 М.
Difference between cookies, session and tokens
11:53
Valentin Despa
Рет қаралды 635 М.
Session Authentication in Express
40:43
Code Realm
Рет қаралды 146 М.
What Is JWT and Why Should You Use JWT
14:53
Web Dev Simplified
Рет қаралды 1,2 МЛН