In django, are all session data deleted if a user logs out? -


I need to track some information about users, but want to keep it for a certain time period, Say a week.

If I set this value through request.sessions, and the user logs out, can I retrieve it if they log in later? It all assumes that my sessions are normally set to expire in 30 days, if the user is logged out.

While thinking about the problem above, I decided to store the data in a table, but I still have to use the cookies because of relevance for referenc Have also decided.

This will depend on your session backend. But when you log out, the default backend ( backends.db ) removes the row from the session table.

I recommend adding data to a field in the user profile. Using the session will give you problems, even if you do not delete the data. The next time the user logs in to you, he does not know which session ID he used the last time, and generally you only have to see the session ID is not a user ID, so you can use a special user You can get all the sessions owned by


Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -