Extend session timeout

Before posting something, READ the changelog, WATCH the videos, howto and provide following:
Your install is: Bare metal, ESXi, what CPU model, RAM, HD, what EVE version you have, output of the uname -a and any other info that might help us faster.

Moderator: mike

Post Reply
guillaume.vilar
Posts: 5
Joined: Mon Mar 02, 2020 12:52 pm

Extend session timeout

Post by guillaume.vilar » Tue Jun 09, 2020 9:21 am

Hi,

I would like to extend to 24 hours the cookie session time-out (by default it is 1 hour).

As per the file /opt/unetlab/html/includes/init.php I need to create the file /opt/unetlab/html/includes/config.php:

In init.php:

Code: Select all

 
 * This file include all needed files and variables to run UNetLab. Don't
 * edit this file, it will be overwritten when updating. Create a new file
 * named 'config.php' under /opt/unetlab/html/includes and set some of all
 * the following parameters:
 *
 * define('DATABASE', '/opt/unetlab/data/database.sdb');
 * define('FORCE_VM', 'auto');
 * define('SESSION', '3600');
 * define('THEME', 'default');
 * define('TIMEZONE', 'Europe/Rome');
 
Here is my config.php:

Code: Select all

/opt/unetlab/html/includes# cat config.php
<?php
define('SESSION', '86400');
?>
However, after doing that I'm not able to login to the UI. It is Loading continuously.
I realize after some tests that I can set the timeout to 9999 seconds, but it is not working up to 10000 seconds
(maybe a 5 digits error?).

Can somebody help me to troubleshoot this? Which log file can I look at?
In the access.txt I can see 412 HTTP error codes (412 Precondition Failed client error response code indicates that access to the target resource has been denied.):

Code: Select all

[09/Jun/2020:10:17:54 +0100] "POST /api/auth/login HTTP/1.1" 200 502 "-" "python-requests/2.18.1"
[09/Jun/2020:10:17:54 +0100] "GET /api/status HTTP/1.1" 412 419 "-" "python-requests/2.18.1"
127.0.0.1 - - [09/Jun/2020:10:17:54 +0100] "POST /html5/api/tokens HTTP/1.0" 200 388 "-" "-"
 [09/Jun/2020:10:17:54 +0100] "POST /api/auth/login HTTP/1.1" 200 502 "-" "python-requests/2.12.4"
 [09/Jun/2020:10:17:54 +0100] "GET /api/status HTTP/1.1" 412 419 "-" "python-requests/2.12.4"
 

Thanks,

Guillaume

guillaume.vilar
Posts: 5
Joined: Mon Mar 02, 2020 12:52 pm

Re: Extend session timeout

Post by guillaume.vilar » Sun Jun 14, 2020 12:16 pm

Hi,

I tested this way of extending the cookie session timeout on a fresh new 2.0.3-110 eve-ng VM.
It is working as expected.

In the first case, I was running 2.0.3-86 before the upgrade so my assumption is that something
is not working because I upgraded from this version.

As a next step, I would like to do kind of a "factory reset" of my 2.0.3-110 eve VM. Is there a way to do that?
I would like to clean the database and remove all the files that were created, in order to do a fresh start.
I would like to keep the 2.0.3-110 version.

Is there a way to do that?

Thanks,

Guillaume

Post Reply