Why and how to cookies instead of localStorage for our JWT in Svelte
If your SvelteKit (or any frontend) app can, it should probably use httponly secure Cookies to store your JWT/session information rather than using localStorage. It's more secure against XSS. In this episode, I show you the small changes required to make that work in Svelte.
š¤Æ Support on Patreon
ā±ļø Timestamps:
š Newsletter:
šŖElsewhere:
šConcepts:
šResources:
š¬ Subscribe!
My name is David W Parker and Iām creating and publishing videos on ProgrammingTIL to help teach anyone and everyone who wants to code. Iām a huge fan of Ruby on Rails, Svelte, TailwindCSS, and WebGL. Iāve used React a lot in the past, as well as some Vue and AngularJS. Iāve done some professional Python and Django. I like to create real applications and my tutorials will walk you through how to build something real from beginning-to-end.
š¤Æ Support on Patreon
- https://www.patreon.com/davidwparker
ā±ļø Timestamps:
- 00:00 - Introduction
- 00:45 - Demo
- 01:55 - api.js changes
- 02:25 - svelte file changes
š Newsletter:
- https://www.programmingtil.com/
šŖElsewhere:
- Twitter: https://twitter.com/davidwparker
- Twitter: https://twitter.com/programmingtil
- GitHub: https://github.com/davidwparker
šConcepts:
- Cookies vs LocalStorage for JWTs
šResources:
- https://github.com/davidwparker/programmingtil-svelte/tree/ep16
š¬ Subscribe!
- http://bit.ly/subdavidwparker
My name is David W Parker and Iām creating and publishing videos on ProgrammingTIL to help teach anyone and everyone who wants to code. Iām a huge fan of Ruby on Rails, Svelte, TailwindCSS, and WebGL. Iāve used React a lot in the past, as well as some Vue and AngularJS. Iāve done some professional Python and Django. I like to create real applications and my tutorials will walk you through how to build something real from beginning-to-end.
svelte #sveltekit
Ā© programmingtil.com