SproutCMS

This is the code documentation for the SproutCMS project

source of /sprout/config/session.php

  1. <?php
  2. /*
  3.  * kate: tab-width 4; indent-width 4; space-indent on; word-wrap off; word-wrap-column 120;
  4.  * :tabSize=4:indentSize=4:noTabs=true:wrap=false:maxLineLen=120:mode=php:
  5.  *
  6.  * Copyright (C) 2016 Karmabunny Pty Ltd.
  7.  *
  8.  * This file is a part of SproutCMS.
  9.  *
  10.  * SproutCMS is free software: you can redistribute it and/or modify it under the terms
  11.  * of the GNU General Public License as published by the Free Software Foundation, either
  12.  * version 2 of the License, or (at your option) any later version.
  13.  *
  14.  * For more information, visit <http://getsproutcms.com>.
  15.  */
  16.  
  17. /**
  18.  * @package Session
  19.  *
  20.  * Session driver name: native/database
  21.  */
  22. $config['driver'] = 'native';
  23.  
  24. /**
  25.  * Session storage parameter, used by drivers.
  26.  */
  27. $config['storage'] = '';
  28.  
  29. /**
  30.  * Session name.
  31.  * It must contain only alphanumeric characters and underscores. At least one letter must be present.
  32.  */
  33. $config['name'] = 'PHP5BLVI80';
  34.  
  35. /**
  36.  * Session parameters to validate: userAgent, ip_address, expiration.
  37.  */
  38. $config['validate'] = array();
  39.  
  40. /**
  41.  * Enable or disable session encryption.
  42.  * Note: this has no effect on the native session driver.
  43.  * Note: the cookie driver always encrypts session data. Set to TRUE for stronger encryption.
  44.  */
  45. $config['encryption'] = FALSE;
  46.  
  47. /**
  48.  * Session lifetime. Number of seconds that each session will last.
  49.  * A value of 0 will keep the session active until the browser is closed (with a limit of 24h).
  50.  */
  51. $config['expiration'] = 0;
  52.  
  53. /**
  54.  * Number of page loads before the session id is regenerated.
  55.  * A value of 0 will disable automatic session id regeneration.
  56.  */
  57. $config['regenerate'] = 0;
  58.  
  59. /**
  60.  * Percentage probability that the gc (garbage collection) routine is started.
  61.  * N.B. On Debian systems, there's a system cron that cleans up the session
  62.  * data, so PHP's session garbage collector should be turned off.
  63.  * @see https://bugs.launchpad.net/ubuntu/+source/php5/+bug/619855
  64.  * @see http://stackoverflow.com/questions/2904862/issues-with-php-5-3-and-sessions-folder
  65.  * @see http://somethingemporium.com/2007/06/obscure-error-with-php5-on-debian-ubuntu-session-phpini-garbage
  66.  */
  67. if (preg_match('/ubuntu|debian/i', php_uname())) {
  68. $config['gc_probability'] = 0;
  69. } else {
  70. $config['gc_probability'] = 2;
  71. }
  72.