]> git.mxchange.org Git - friendica.git/blobdiff - include/auth.php
It is now possible to connect to a db server with host:port
[friendica.git] / include / auth.php
index 636b5b153afa9d24ada00b119b561bacb23fdacb..c1a6120dbbcf6258e66458b2950ef5bb63c29724 100644 (file)
@@ -1,4 +1,7 @@
 <?php
+
+use \Friendica\Core\Config;
+
 require_once('include/security.php');
 require_once('include/datetime.php');
 
@@ -19,8 +22,10 @@ if (isset($_COOKIE["Friendica"])) {
                        }
 
                        // Renew the cookie
-                       // Expires after 90 days - TODO: use a configuration variable
-                       new_cookie(90*24*60*60, $r[0]);
+                       // Expires after 7 days by default,
+                       // can be set via system.auth_cookie_lifetime
+                       $authcookiedays = Config::get('system', 'auth_cookie_lifetime', 7);
+                       new_cookie($authcookiedays*24*60*60, $r[0]);
 
                        // Do the authentification if not done by now
                        if (!isset($_SESSION) OR !isset($_SESSION['authenticated'])) {