According to Django, there is a "user" attribute in the HttpRequest object that represents the currently logged in user if the Django installation is active authentication. What is the user requesting object? Does the middleware set the user in a cookie and save that cookie in the client browser, when the user logs in? In my code, I save the user ID (auth_user table) after logging in to a session variable and I usually check it on every page. If this information is always available in the request item, then I do not have to do this. All I need to do is check request.user.id. Is it true?
Thank you.