Moorani
Moorani

Reputation: 129

Maintaining a session using Django REST API

Is there any way to maintain state (session) of the user instead of storing tokens in local storage on the client side which makes them vulnerable to theft. And how exactly can we do that in Django Rest Framework?

Right now I have OAuth implemented in my project, however, since access tokens can be exchanged or stolen, I am wondering if maintaining a session on server-side in Django is possible or not?

Upvotes: 4

Views: 2961

Answers (1)

Deji Kadri
Deji Kadri

Reputation: 7

Use the below statement:

request.session['mysession'] = "username"

Upvotes: -4

Related Questions