3liz / lizmap-web-client

Transfer a QGIS project on a server, Lizmap is providing the web interface to browse it
https://www.lizmap.com
Mozilla Public License 2.0
248 stars 141 forks source link

[Question]: User automatically logged of #4515

Open meyerlor opened 2 weeks ago

meyerlor commented 2 weeks ago

What is the question? (in English)

I observed that after some time of inactivity in Lizmap you get logged off - this is a bit annoying, especially if you are a new user and do not know about this behaviour - you can still zoom and pan the map, but nothing will load (so my customer concluded that Lizmap is slow..). You have reload the page, log in again and then you can work again in Lizmap. Can this behaviour be disabled somehow?

Versions, safeguards, check summary etc

Versions :

List of safeguards :
* Mode : normal * Allow parent folder : no * Prevent other drive : yes * Prevent PG service : yes * Prevent PG Auth DB : yes * Force PG user&pass : yes * Prevent ECW : yes

Check Lizmap plugin

Operating system

Ubuntu 22.04

Browsers

Firefox, Microsoft Edge

Browsers version

Firefox 115

Relevant log output

No response

guenterw commented 2 weeks ago

in my experience it depends on the setting of the general duration of the user session (Apache /php). I have set this to 12 hours. However, the security aspect should be taken into account.

Irrespective of this, it would certainly make sense if the Lizmap web client were to give the user a corresponding message when they are logged out.

gioman commented 2 weeks ago

Irrespective of this, it would certainly make sense if the Lizmap web client were to give the user a corresponding message when they are logged out.

Or add an option in the admin backend to set the length of the session.

Gustry commented 2 weeks ago

Or add an option in the admin backend to set the length of the session.

It's linked to the PHP server, not Lizmap if I'm correct. I think to the variable session.gc_maxlifetime, which is by default 24 minutes. (1440 seconds)

gioman commented 2 weeks ago

It's linked to the PHP server, not Lizmap if I'm correct. I think to the variable session.gc_maxlifetime, which is by default 24 minutes. (1440 seconds

@Gustrybut I think that is possible to override it at the application level

<?php
// Set the session lifetime to 1 hour (3600 seconds)
ini_set('session.gc_maxlifetime', 3600);

// Set the session cookie lifetime to 1 hour (3600 seconds)
ini_set('session.cookie_lifetime', 3600);

// Start the session
session_start();

// Your session handling code here
?
Gustry commented 2 weeks ago

Ok, I didn't know