# "I am using Django Rest Framework (DRF) with session authentication, but I am encountering an issue where sessions are not working in the Chrome browser. Can anyone provide assistance or guidance?"

**URL:** <https://forum.djangoproject.com/t/i-am-using-django-rest-framework-drf-with-session-authentication-but-i-am-encountering-an-issue-where-sessions-are-not-working-in-the-chrome-browser-can-anyone-provide-assistance-or-guidance/23879>\
**Category:** Forms & APIs\
**Created:** [September 15, 2023, 9:54am UTC](https://forum.djangoproject.com/t/i-am-using-django-rest-framework-drf-with-session-authentication-but-i-am-encountering-an-issue-where-sessions-are-not-working-in-the-chrome-browser-can-anyone-provide-assistance-or-guidance/23879 "2023-09-15T09:54:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mallelamurali89](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/mallelamurali89/32/15936_2.png) [@mallelamurali89](https://forum.djangoproject.com/u/mallelamurali89)\
**Post date:** [September 15, 2023, 9:54am UTC](https://forum.djangoproject.com/t/i-am-using-django-rest-framework-drf-with-session-authentication-but-i-am-encountering-an-issue-where-sessions-are-not-working-in-the-chrome-browser-can-anyone-provide-assistance-or-guidance/23879/1 "2023-09-15T09:54:22Z")

</div>

I am using Django Rest Framework (DRF) with session authentication, but I am encountering an issue where sessions are not working in the Chrome browser. Can anyone provide assistance or guidance?

---

<div class="post-metadata">

**Author:** ![addwebsolution](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/addwebsolution/32/23762_2.png) [@addwebsolution](https://forum.djangoproject.com/u/addwebsolution)\
**Post date:** [September 15, 2023, 9:57am UTC](https://forum.djangoproject.com/t/i-am-using-django-rest-framework-drf-with-session-authentication-but-i-am-encountering-an-issue-where-sessions-are-not-working-in-the-chrome-browser-can-anyone-provide-assistance-or-guidance/23879/2 "2023-09-15T09:57:35Z")

</div>

Have you created APIs and use them in other frameworks like React?  
Please give more context on how you are trying to work with sessions.

---

<div class="post-metadata">

**Author:** ![mallelamurali89](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/mallelamurali89/32/15936_2.png) [@mallelamurali89](https://forum.djangoproject.com/u/mallelamurali89)\
**Post date:** [September 15, 2023, 11:04am UTC](https://forum.djangoproject.com/t/i-am-using-django-rest-framework-drf-with-session-authentication-but-i-am-encountering-an-issue-where-sessions-are-not-working-in-the-chrome-browser-can-anyone-provide-assistance-or-guidance/23879/3 "2023-09-15T11:04:20Z")

</div>

Yes, on the frontend, I am using Next.js, and on the backend, I’m using Django Rest Framework (DRF) with session authentication.

During the login process, I store a few values in the session like this:

1. Login API: After validating the user’s credentials, I store a value in the session as follows:

verify\_code = 123456  
request.session[‘verify\_code’] = verify\_code

1. Verify Code API: In this API, I attempt to retrieve the session value using request.session.get(‘verify\_code’), but I am unable to retrieve it. Instead, I’m getting a None value.

I’m facing this issue specifically in Chrome and Edge browsers. How can I resolve this?
