# How to extend the Okta session

**URL:** <https://devforum.okta.com/t/how-to-extend-the-okta-session/26841>\
**Category:** API\
**Tags:** api, javascript\
**Created:** [February 16, 2024, 1:45am UTC](https://devforum.okta.com/t/how-to-extend-the-okta-session/26841 "2024-02-16T01:45:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![David.Klempfner](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/david.klempfner/32/4807_2.png) [@David.Klempfner](https://devforum.okta.com/u/David.Klempfner)\
**Post date:** [February 16, 2024, 1:45am UTC](https://devforum.okta.com/t/how-to-extend-the-okta-session/26841/1 "2024-02-16T01:45:25Z")

</div>

Hi,

I have a few questions:

According to [https://support.okta.com/help/s/article/Why-is-the-GET-Current-Session-API-call-extending-the-users-session:](https://support.okta.com/help/s/article/Why-is-the-GET-Current-Session-API-call-extending-the-users-session:)  
“This action retrieves the user’s session cookie and extends the session”

1. **What is the point of _/api/v1/sessions/me/lifecycle/refresh_ if _/api/v1/sessions/me_ also extends the session?**

In the following screenshots, you can see two calls to _ **/api/v1/sessions/me/lifecycle/refresh.** _

 ![1](https://global.discourse-cdn.com/oktadev/original/2X/b/be5ac6db2433fcbc76dffa9c9cbec1c6abaf698e.png)  
 ![2](https://global.discourse-cdn.com/oktadev/original/2X/c/c7584443e84ea7c7b0a559e029356d7311d15ae0.png)  
 ![3](https://global.discourse-cdn.com/oktadev/original/2X/d/d591da8b9b1875ca3d437080486668cbf7808023.png)  
 ![4](https://global.discourse-cdn.com/oktadev/original/2X/0/0e3202ae66f93de39b6cc381304806054777f0fc.png)

In both requests, the sid cookie has the same expiry time of 01:10:46, which means the session is not extended.  
This is because the response does not have a sid cookie with an increased expiry date. It only has a JESSIONID cookie.

However, the response body has a new “expiresAt” date time which is what I’d expect.

Does this “expiresAt” time refer to the state stored on the Okta server for my session?

1. **How can I get an updated sid cookie with an increased expiry date/time so that my session is extended?**

2. **What is the point of the SESSIONID cookie?**

Why are there the equivalent non-cors endpoints with sessionIds?:  
_/api/v1/sessions/{sessionId}_ and _/api/v1/sessions/{sessionId}/lifecycle/refresh_ in [Sessions](https://developer.okta.com/docs/api/openapi/okta-management/management/tag/Session/)?  
To extend the session, don’t you need an updated sid cookie?

If these APIs are meant to be called from our app’s backend, how is the user meant to get a new cookie with an extended expiry?

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/oktadev/original/1X/589c4c5f80de422d01f47cee7185a7fb8227835c.png) [@system](https://devforum.okta.com/u/system)\
**Post date:** [March 17, 2024, 1:45am UTC](https://devforum.okta.com/t/how-to-extend-the-okta-session/26841/2 "2024-03-17T01:45:51Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
