# Session timeout using spring boot webapp

**URL:** <https://community.auth0.com/t/session-timeout-using-spring-boot-webapp/86330>\
**Category:** Get Help\
**Tags:** timeout, spring-security, auth0\
**Created:** [July 3, 2022, 1:36pm UTC](https://community.auth0.com/t/session-timeout-using-spring-boot-webapp/86330 "2022-07-03T13:36:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![guy.hillel](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/guy.hillel/32/36188_2.png) [@guy.hillel](https://community.auth0.com/u/guy.hillel)\
**Post date:** [July 3, 2022, 1:36pm UTC](https://community.auth0.com/t/session-timeout-using-spring-boot-webapp/86330/1 "2022-07-03T13:36:59Z")

</div>

Hi Auth0 community

I’ve followed this [spring boot quickstart](https://auth0.com/docs/quickstart/webapp/java-spring-boot/interactive) and my webapp is now working with my Auth0 tenant using universal login.

I want to apply a session timeout of 15 minutes and force idle users to log in again.

I used to spring session timeout property to adjust the application timeout, and I see that an /authorize request is sent to my custom-domain auth0 tenant. But I get CORS error

```auto
Access to XMLHttpRequest at 'https://.../authorize?....' (redirected from 'http://localhost:8080/...) from origin 'http://localhost:8080' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

```

As I read [here](https://community.auth0.com/t/received-cors-issue-trying-to-reproduce-quickstart-demo-in-rails/60143/3) and [here](https://community.auth0.com/t/received-cors-issue-trying-to-reproduce-quickstart-demo-in-rails/60143/3), this error is given since the authorize endpoint is not called properly since it is called directly from spring.

What are the available solutions for such deployment?

---

<div class="post-metadata">

**Author:** ![nik.baleca](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nik.baleca/32/68749_2.png) [@nik.baleca](https://community.auth0.com/u/nik.baleca)\
**Post date:** [February 18, 2025, 5:44pm UTC](https://community.auth0.com/t/session-timeout-using-spring-boot-webapp/86330/2 "2025-02-18T17:44:03Z")

</div>

Hi @guy.hillel

Welcome to the Auth0 Community!

I am sorry about the late reply to your inquiry.

Regarding the CORS issue that you are receiving, most probably the login is server on a different origin than the one you are requesting it.  
I would recommend to review these community posts:

- [Cors Error No 'Access-Control-Allow-Origin' header is present on the requested resource - #8 by Alwin-dotcom](https://community.auth0.com/t/cors-error-no-access-control-allow-origin-header-is-present-on-the-requested-resource/180778/8)
- [Cors Error No 'Access-Control-Allow-Origin' header is present on the requested resource](https://community.auth0.com/t/cors-error-no-access-control-allow-origin-header-is-present-on-the-requested-resource/180778)

Otherwise, you can modify the session lifetime within the Auth0 Dashboard or using the Management API.  
You can refer to our [documentation](https://auth0.com/docs/manage-users/sessions/configure-session-lifetime-settings) regarding this matter.

If you have any other questions, feel free to leave a reply or post on the community again!

Kind Regards,  
Nik

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [March 4, 2025, 5:44pm UTC](https://community.auth0.com/t/session-timeout-using-spring-boot-webapp/86330/4 "2025-03-04T17:44:39Z")

</div>

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