vaadin / flow

Vaadin Flow is a Java framework binding Vaadin web components to Java. This is part of Vaadin 10+.
Apache License 2.0
620 stars 167 forks source link

If user does not do anything (i.e. use mouse, key press, scrolling etc) for 2 mins then user will be logged out automatically and the page will be redirected to login page: #17704

Closed Imrnkhan closed 1 year ago

Imrnkhan commented 1 year ago

Description of the bug

If user does not do anything (i.e. use mouse, key press, scrolling etc) for 2 mins then user will be logged out automatically and the page will be redirected to login page: spring boot project application java.and this this is my code can any one fix and help out this code demo2-master.zip

Expected behavior

If user does not do anything (i.e. use mouse, key press, scrolling etc) for 2 mins then user will be logged out automatically and the page will be redirected to login page: spring boot project application java.and this this is my code can any one fix and help out this code demo2-master.zip

Minimal reproducible example

spring boot project application java.and this this is my code can any one fix and help out this code demo2-master.zip

Versions

mcollovati commented 1 year ago

I can't see any Vaadin related code in the uploaded demo project. Is something missing in the zip file, or is yours a general question about Spring Security?

Imrnkhan commented 1 year ago

Yes its spring securing based.

On Mon, 25 Sep, 2023, 12:01 pm Marco Collovati, @.***> wrote:

I can't see any Vaadin related code in the uploaded demo project. Is something missing in the zip file, or is yours a general question about Spring Security?

— Reply to this email directly, view it on GitHub https://github.com/vaadin/flow/issues/17704#issuecomment-1733002610, or unsubscribe https://github.com/notifications/unsubscribe-auth/AW3HJZW5BY25IR7KBJW2IUDX4EQMZANCNFSM6AAAAAA5FDWMFA . You are receiving this because you authored the thread.Message ID: @.***>

Imrnkhan commented 1 year ago

its based on Spring Security use in this project one kind of demo when If user does not do anything (i.e. use mouse, key press, scrolling etc) for 2 mins then user will be logged out automatically and the page will be redirected to login page: use dependencies 1.spring security 2. spring web 3. thymeleaf some use of js,html

mcollovati commented 1 year ago

Being not a Vaadin related question, it would probably be better to ask for help on Spring support channels.

You can perhaps try setting the HTTP session timeout to 2 minutes (e.g. server.servlet.session.timeout=2m) and check the Spring Security documentation to learn about handling session expiration (e.g. https://docs.spring.io/spring-security/reference/servlet/authentication/session-management.html#_detecting_timeouts).

On the Vaadin side, the client side sends "keep alive" heartbeat requests, but the default interval is 5 minutes, so with the above session timeout configuration, the session will expire before a heartbeat ping reaches the server. See https://vaadin.com/docs/latest/advanced/application-lifecycle#application.lifecycle.ui-expiration for more information.

I close this issue as it is not strictly related to Vaadin applications. Please comment here or open a new ticket providing additional details, if you think the issues relates to Vaadin.

Imrnkhan commented 1 year ago

Ok, thanks for the update.

On Mon, Sep 25, 2023 at 9:01 PM Marco Collovati @.***> wrote:

Closed #17704 https://github.com/vaadin/flow/issues/17704 as not planned.

— Reply to this email directly, view it on GitHub https://github.com/vaadin/flow/issues/17704#event-10464385541, or unsubscribe https://github.com/notifications/unsubscribe-auth/AW3HJZQ3X2QA554AJ4QEZLTX4GPWVANCNFSM6AAAAAA5FDWMFA . You are receiving this because you authored the thread.Message ID: @.***>