Recall & Review
beginner
What is a session in Django?
A session in Django is a way to store information on the server side about a user across multiple requests. It helps keep track of user data like login status or preferences while they browse the site.
Click to reveal answer
beginner
Why do we need sessions instead of just cookies?
Cookies store data on the user's browser, which can be changed or deleted. Sessions keep data on the server, making it safer and more reliable for storing sensitive info like login details.
Click to reveal answer
beginner
How does Django identify a user's session?
Django uses a session ID stored in a cookie on the user's browser. This ID links to the session data saved on the server, so Django knows which data belongs to which user.
Click to reveal answer
beginner
What kind of data can be stored in a Django session?
You can store any small pieces of information like user preferences, shopping cart items, or login status. It should be data that helps personalize or manage the user's experience.
Click to reveal answer
beginner
How do sessions improve user experience on a website?
Sessions let the website remember who you are and what you did, so you don’t have to log in every time or lose your shopping cart. This makes browsing smoother and more personal.Click to reveal answer
What does Django use to link a user to their session data?
✗ Incorrect
Django stores a unique session ID in a cookie on the user's browser to identify the session data on the server.
Where is session data stored in Django?
✗ Incorrect
Session data is stored securely on the server, not on the user's browser.
Why are sessions safer than cookies for storing sensitive data?
✗ Incorrect
Sessions keep data on the server, so users cannot easily change or see sensitive information.
Which of these is a common use of sessions in Django?
✗ Incorrect
Sessions are often used to remember if a user is logged in during their visit.
What happens if a user deletes their cookies related to sessions?
✗ Incorrect
Deleting cookies removes the session ID, so the server can’t identify the user’s session.
Explain in your own words why sessions are important in web applications like those built with Django.
Think about how websites remember you when you log in or add items to a cart.
You got /4 concepts.
Describe how Django uses cookies and sessions together to keep track of a user.
Focus on the role of the cookie and the server in managing sessions.
You got /4 concepts.