# Get browser session cookie for web app using curl

**URL:** <https://devforum.okta.com/t/get-browser-session-cookie-for-web-app-using-curl/23823>\
**Category:** OAuth/OIDC\
**Created:** [March 31, 2023, 1:28pm UTC](https://devforum.okta.com/t/get-browser-session-cookie-for-web-app-using-curl/23823 "2023-03-31T13:28:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![markdjones82](https://avatars.discourse-cdn.com/v4/letter/m/f9ae1b/32.png) [@markdjones82](https://devforum.okta.com/u/markdjones82)\
**Post date:** [March 31, 2023, 1:28pm UTC](https://devforum.okta.com/t/get-browser-session-cookie-for-web-app-using-curl/23823/1 "2023-03-31T13:28:28Z")

</div>

All,  
I am trying to figure out how to get a browser cookie that can be sent as a Header using curl to the rest API of a flask application. If I login using the browser it’s /login page redirects me to Okta, I sign in, and it redirects me back as authenticated. I can get the session cookie from the browser and use that to run commands against an API using curl.

What I haven’t been able to fiigure out is how to get that browser session cookie using curl since it redirects to Okta. Any help? Is there a better way to go about this?

---

<div class="post-metadata">

**Author:** ![dawoudt](https://avatars.discourse-cdn.com/v4/letter/d/ecb155/32.png) [@dawoudt](https://devforum.okta.com/u/dawoudt)\
**Post date:** [April 5, 2023, 6:12am UTC](https://devforum.okta.com/t/get-browser-session-cookie-for-web-app-using-curl/23823/2 "2023-04-05T06:12:38Z")

</div>

Hi @markdjones82, if you are trying to use our API via http client like curl you can use an API token instead. Check this doc out for more info - [Create an API token | Okta Developer](https://developer.okta.com/docs/guides/create-an-api-token/)

---

<div class="post-metadata">

**Author:** ![andrea](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/andrea/32/2172_2.png) [@andrea](https://devforum.okta.com/u/andrea)\
**Post date:** [February 13, 2024, 11:09pm UTC](https://devforum.okta.com/t/get-browser-session-cookie-for-web-app-using-curl/23823/3 "2024-02-13T23:09:02Z")

</div>

Closed on February 13, 2024, 11:09pm UTC


