CORS error on Okta authorize api end point from frontend

My ASP .Net MVC Angular web application is okta enabled and using Okta.ASPNet SDK.

Problem:
As a application user when web application is left idle for some time and click on any link (dashboard, project) getting below errors. In result user has to refresh the page forcefully.

Please suggest what could be the resoluton here.

The /authorize endpoint does NOT support CORS/AJAX requests, you must do a browser redirect to this endpoint, as noted in our docs.

Thanks. Could you suggest how I can achive this with ajax call. Browser rediect will refresh the page. Is there anyway of extend the session token without redirect.

Does the user already have an okta session, or are you still looking to exchange the sessionToken for a session cookie set on the Okta domain? All endpoints that support the sessionToken MUST use a redirect so that the cookie can be set on the Okta domain and the user sent back to the target (for OIDC, the redirect_uri)

If they already have an Okta session, then you can make a CORS request to this endpoint (note this will fail if your app is on a different domain than your Okta org and 3rd party cookies are blocked).

This is regarding the cookie based authentication expiration timeout. After user authorization, Okta MVC middleware create a cookie, which got expired after 15-20 minuntes and redirect to authorize url.

I need to increase this cookie timeout. I have tried to set the ExpireTimeSpan as 2 hrs but still is expiring in 15-20 min only.