Merge pull request #213 from engelsystem/remove-sessionhelper
remove sessionhelper
This commit is contained in:
commit
a92e1e3ea6
|
@ -18,4 +18,8 @@
|
||||||
|
|
||||||
Das Engelsystem ist jetzt einsatzbereit.
|
Das Engelsystem ist jetzt einsatzbereit.
|
||||||
|
|
||||||
|
## Session Einstellungen:
|
||||||
|
* Einstellungen für Cookies und Sessions bitte in der PHP Config des Servers vornehmen.
|
||||||
|
* Sowohl Apache als auch nginx bieten Möglichkeiten für verschiedene Konfigurationen pro VirtualHost an
|
||||||
|
|
||||||
Fehler bitte auf Github melden: https://github.com/engelsystem/engelsystem/issues
|
Fehler bitte auf Github melden: https://github.com/engelsystem/engelsystem/issues
|
||||||
|
|
|
@ -76,9 +76,6 @@ require_once realpath(__DIR__ . '/../includes/pages/user_shifts.php');
|
||||||
|
|
||||||
require_once realpath(__DIR__ . '/../vendor/parsedown/Parsedown.php');
|
require_once realpath(__DIR__ . '/../vendor/parsedown/Parsedown.php');
|
||||||
|
|
||||||
if (! defined('PHPUNIT_TESTSUITE')) {
|
|
||||||
session_lifetime(24 * 60, preg_replace("/[^a-z0-9-]/", '', md5(__DIR__)));
|
|
||||||
}
|
|
||||||
session_start();
|
session_start();
|
||||||
|
|
||||||
gettext_init();
|
gettext_init();
|
||||||
|
|
|
@ -1,30 +0,0 @@
|
||||||
<?php
|
|
||||||
/**
|
|
||||||
* Set lifetime of php session.
|
|
||||||
*
|
|
||||||
* @param int $lifetime
|
|
||||||
* Lifetime in minutes
|
|
||||||
* @param string $application_name
|
|
||||||
* Name of the application
|
|
||||||
*/
|
|
||||||
function session_lifetime($lifetime, $application_name) {
|
|
||||||
// Set session save path and name
|
|
||||||
$session_save_path = '/tmp/' . $application_name;
|
|
||||||
if (! file_exists($session_save_path))
|
|
||||||
mkdir($session_save_path);
|
|
||||||
if (file_exists($session_save_path))
|
|
||||||
session_save_path($session_save_path);
|
|
||||||
session_name($application_name);
|
|
||||||
|
|
||||||
// Set session lifetime
|
|
||||||
ini_set('session.gc_maxlifetime', $lifetime * 60);
|
|
||||||
ini_set('session.gc_probability', 1);
|
|
||||||
ini_set('session.gc_divisor', 100);
|
|
||||||
|
|
||||||
// Cookie settings (lifetime)
|
|
||||||
ini_set('session.cookie_secure', ! (isset($_SERVER['HTTP_HOST']) && preg_match("/^localhost/", $_SERVER["HTTP_HOST"]) || isset($_GET['debug'])));
|
|
||||||
ini_set('session.use_only_cookies', true);
|
|
||||||
ini_set('session.cookie_lifetime', $lifetime * 60);
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
|
Loading…
Reference in New Issue