How to prevent session timeout in Symfony 1.0?

I used the PHP MVC Symfony framework to create a web application on demand.

He has an annoying error - the session expires after about 15-30 minutes of inactivity. There is a config directive to prevent session expiration, but it does not work. Even workarounds like this one didn't help me.

I intend not to upgrade to Symfony 1.1 (which fixes this error) for the foreseeable future.

Has anyone been there and decided? I would be very grateful for a hint or two!

+4
source share
4 answers

I looked at it, and my colleague agrees that calling a page with a heartbeat should work, you just need to make sure that the called action resets the session timer (things like completing the ajax field do not do this on their own).

+2
source

The company I work for uses Symfony, and the workaround we used is to trigger a warning with javascript before the user logs out. I suspect there is a way to make "heartbeat" ajax calls to the server to start the timer on reset, but this can be a big problem. I think that there may not be a complete fix suitable for you, although it might be a rewrite of the session handler.

Sorry, I could not be more specific, if I have such an opportunity, I will ask our Symfony developers if they find out about the best solution.

0
source

you can always set the timeout to a certain amount (for example, 10 days or so)

all: .settings: timeout: 864000 
0
source

you can use

 all: .settings: timeout: false 
0
source

Source: https://habr.com/ru/post/1276420/


All Articles