Dotclear

Changeset 3157:9752ee4c8a5b for inc


Ignore:
Timestamp:
01/19/16 12:23:01 (10 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
default
Message:

Make Session TTL adjustable (by defining DC_SESSION_TTL constant in config.php, ex : '120 minutes' ), closes #1941

Location:
inc
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • inc/core/class.dc.core.php

    r3138 r3157  
    6060     { 
    6161          if (defined('DC_START_TIME')) { 
    62                $this->stime=DC_START_TIME; 
     62               $this->stime = DC_START_TIME; 
    6363          } else { 
    6464               $this->stime = microtime(true); 
     
    8888          $this->prefix = $prefix; 
    8989 
     90          $ttl = DC_SESSION_TTL; 
     91          if (!is_null($ttl)) { 
     92               if (substr(trim($ttl),0,1) != '-') { 
     93                    // Clearbricks requires negative session TTL 
     94                    $ttl = '-'.trim($ttl); 
     95               } 
     96          } 
     97 
    9098          $this->error = new dcError(); 
    9199          $this->auth = $this->authInstance(); 
    92           $this->session = new sessionDB($this->con,$this->prefix.'session',DC_SESSION_NAME,'',null,DC_ADMIN_SSL); 
     100          $this->session = new sessionDB($this->con,$this->prefix.'session',DC_SESSION_NAME,'',null,DC_ADMIN_SSL,$ttl); 
    93101          $this->url = new dcUrlHandlers(); 
    94102 
  • inc/prepend.php

    r3126 r3157  
    155155if (!defined('DC_XMLRPC_URL')) { 
    156156     define('DC_XMLRPC_URL','%1$sxmlrpc/%2$s'); 
     157} 
     158 
     159if (!defined('DC_SESSION_TTL')) { 
     160     define('DC_SESSION_TTL',null); 
    157161} 
    158162 
Note: See TracChangeset for help on using the changeset viewer.

Sites map