# Accessing request headers in Dash

**URL:** <https://community.plotly.com/t/accessing-request-headers-in-dash/5320>\
**Category:** Dash Python\
**Created:** [August 9, 2017, 11:47pm UTC](https://community.plotly.com/t/accessing-request-headers-in-dash/5320 "2017-08-09T23:47:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Itayd](https://avatars.discourse-cdn.com/v4/letter/i/ecae2f/32.png) [@Itayd](https://community.plotly.com/u/Itayd)\
**Post date:** [August 9, 2017, 11:47pm UTC](https://community.plotly.com/t/accessing-request-headers-in-dash/5320/1 "2017-08-09T23:47:15Z")

</div>

Hello,

I’m using the basic access authentication in Dash. Is there a way to access the request header via Dash? I’d like to parse the username from the request so that I can automatically populate some values in my app based on the logged in user.

Many thanks

---

<div class="post-metadata">

**Author:** ![radekwlsk](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/radekwlsk/32/1385_2.png) [@radekwlsk](https://community.plotly.com/u/radekwlsk)\
**Post date:** [August 10, 2017, 10:43am UTC](https://community.plotly.com/t/accessing-request-headers-in-dash/5320/2 "2017-08-10T10:43:49Z")

</div>

I am using `flask.session` to store such things as user and session tokens.  
Take a look here: [http://flask.pocoo.org/docs/0.10/quickstart/#sessions](http://flask.pocoo.org/docs/0.10/quickstart/#sessions)

On authentication simply save what you need in `flask.session` dictionary, and remove those values on logout.
