Allow specifying cookie lifetime via config variable
Tweak $a->config['system']['auth_cookie_lifetime']
This commit is contained in:
parent
e9f1a2e276
commit
05b6891e89
2 changed files with 7 additions and 2 deletions
|
@ -91,3 +91,6 @@ $a->config['system']['directory'] = 'https://dir.friendica.social';
|
||||||
|
|
||||||
// Allowed protocols in link URLs; HTTP protocols always are accepted
|
// Allowed protocols in link URLs; HTTP protocols always are accepted
|
||||||
$a->config['system']['allowed_link_protocols'] = array('ftp', 'ftps', 'mailto', 'cid', 'gopher');
|
$a->config['system']['allowed_link_protocols'] = array('ftp', 'ftps', 'mailto', 'cid', 'gopher');
|
||||||
|
|
||||||
|
// Authentication cookie lifetime, in days
|
||||||
|
$a->config['system']['auth_cookie_lifetime'] = 7
|
||||||
|
|
|
@ -19,8 +19,10 @@ if (isset($_COOKIE["Friendica"])) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Renew the cookie
|
// Renew the cookie
|
||||||
// Expires after 90 days - TODO: use a configuration variable
|
// Expires after 7 days by default,
|
||||||
new_cookie(90*24*60*60, $r[0]);
|
// can be set via system.auth_cookie_lifetime
|
||||||
|
$authcookiedays = get_config('system','auth_cookie_lifetime') || 7;
|
||||||
|
new_cookie($authcookiedays*24*60*60, $r[0]);
|
||||||
|
|
||||||
// Do the authentification if not done by now
|
// Do the authentification if not done by now
|
||||||
if (!isset($_SESSION) OR !isset($_SESSION['authenticated'])) {
|
if (!isset($_SESSION) OR !isset($_SESSION['authenticated'])) {
|
||||||
|
|
Loading…
Reference in a new issue