tags:

views:

1085

answers:

5

I've used the PHP MVC framework Symfony to build an on-demand web app.

It has an annoying bug - 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 such as this one did not help me.

I intend not to migrate to Symfony 1.1 (which fixes this bug) in the foreseeable future.

Has anyone been there and solved it? I would be most grateful for a hint or two!

A: 

Hi Tomas. The company I work for has been using Symfony and the workaround that we've used is to trigger a warning with javascript before the user gets logged out. I suspect that there is a a way to make 'heartbeat' ajax calls to the server to trigger the timer to reset, but that may be a lot of trouble. I think that there may not be a full fix that's suitable for you though, except maybe re-writing the session handler.

Sorry I couldn't be more specific, if I get the chance, I'll ask our Symfony devs if they know of a better solution.

Dana the Sane
+1  A: 

I looked into it, and my coworker agrees that a heartbeat page call should work, you just have to make sure that the action invoked does reset the session timer (things like ajax field completion don't do this on their own).

Dana the Sane
A: 

you could always set timeout to some large number ( like 10 days or so )

all:
  .settings:
    timeout:    864000
deresh
This does not work in symfony 1.0, unfortunately
Tomas Kohl
A: 

@deresh: I tried doing so, but to no avail.. it's kind of frustrating not being able to fix this simple thing!

A: 

You can use

all:
  .settings:
    timeout: false
David Coallier
Does not work in Symfony 1.0
Jon Winstanley