From the course: Advanced Django Project: Build High-Traffic Websites with Django
Unlock the full course today
Join today to access over 25,100 courses taught by industry experts.
Sessions - Django Tutorial
From the course: Advanced Django Project: Build High-Traffic Websites with Django
Sessions
- [Instructor] Sessions are a way of storing data and tying it to a website user, not necessarily to a user account like we've been thinking about users, so it's not tied to a Django user ID necessarily, but it's tied to your current web session. And when you enable sessions in Django, it will put a session ID in the user's cookie, like this. We have a session ID there, and this session ID lasts as long as your cookie does. So session data can store a lot of different things. You might use it as a cache, or if you're building a commerce site, it's what most sites use to hold the data about what's in the user's cart, particularly for anonymous users. And in this video, we're going to look at how to save a users in progress posts as they type them so they don't lose their work if they close the page or navigate a way on this new ad post page. The default Django installation already has sessions provided in the middle…