0

i want to store the session history for users in my application , any app can be used ? if not how some thing like that can be made ? i want to have complete history for IPS , browsers , location ..etc

i have tried to used Django-sessions app from jassband but it the session is deleted after the user logout

thanks

tamdo
  • 3
  • 1
  • 3

1 Answers1

0

There can be multiple ways to do this :

1.) You can store it in cookies : Solution

username = 'john.smith'  # Grab this from the login form

response = render_to_response(...)
response.set_cookie('the_current_user', username, max_age=9999999999)

Check the documentation here.

2.) Overriding logout method with you custom logout : Solution

3.) Use database table to store the cart info.

  • thanks for your reply but iam sorry , your answer not related to my question . may be iam not clear enough . i want to save the meta information of all users sessions even he logged out like (Ip ,Browser , time ..etc) for auditing purpose – tamdo Aug 11 '21 at 09:09
  • As stated above in point no. 2, even If you want to use django-session then, You can override the logout functionality in [this](https://github.com/jazzband/django-user-sessions/blob/master/user_sessions/utils/tests.py) to avoid session delete. – Shivendra Pratap Kushwaha Aug 11 '21 at 11:49
  • didnot notice it thanks for the comment again and sorry for my first comment – tamdo Aug 12 '21 at 04:01