# How to get session details from request in "doc" object in autoload()

**URL:** <https://discourse.holoviz.org/t/how-to-get-session-details-from-request-in-doc-object-in-autoload/2561>\
**Category:** Panel\
**Tags:** bokeh, panel\
**Created:** [July 15, 2021, 2:00pm UTC](https://discourse.holoviz.org/t/how-to-get-session-details-from-request-in-doc-object-in-autoload/2561 "2021-07-15T14:00:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Solo\_Leveling](https://discourse.holoviz.org/letter_avatar_proxy/v4/letter/s/439d5e/32.png) [@Solo\_Leveling](https://discourse.holoviz.org/u/Solo_Leveling)\
**Post date:** [July 15, 2021, 2:00pm UTC](https://discourse.holoviz.org/t/how-to-get-session-details-from-request-in-doc-object-in-autoload/2561/1 "2021-07-15T14:00:13Z")

</div>

Hi all,

I tried to integrate panel with Django.  
I am referring the documentation : [Documentation to integrate Django and Panel](https://panel.holoviz.org/user_guide/Django_Apps.html)  
Here I am loading data for dashboard using **autoload()**, but, for my use-case dashboard is user-specific, hence I have to get the **session ID(username)** from request.  
But, the **autoload()** function passes parameter **doc** object instead of **request**.  
So, I am unable to access username, in the **pn\_app()**.  
Then i tried **doc.session\_context.request.session[‘username’]**, but it gives username for the first login, but if i login with different account in different browser, it gives me error

`ERROR:bokeh.application.application:Error running application handler <bokeh.application.handlers.function.FunctionHandler object at 0x000002B37C3ECE20>: 'username'` .

It would be very helpful if someone could help me out with this issue.

Please let me know if you need any more details.
