session.php 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <?php
  2. /**
  3. * Part of the Fuel framework.
  4. *
  5. * @package Fuel
  6. * @version 1.5
  7. * @author Fuel Development Team
  8. * @license MIT License
  9. * @copyright 2010 - 2013 Fuel Development Team
  10. * @link http://fuelphp.com
  11. */
  12. /**
  13. * NOTICE:
  14. *
  15. * If you need to make modifications to the default configuration, copy
  16. * this file to your app/config folder, and make them in there.
  17. *
  18. * This will allow you to upgrade fuel without losing your custom config.
  19. */
  20. return array(
  21. /**
  22. * global configuration
  23. */
  24. // set it to false to prevent the static session from auto-initializing, know that it might make your session
  25. // expire sooner because it's not updated when it's not used. note that auto-initializing always loads the default driver
  26. 'auto_initialize' => true,
  27. // if no session type is requested, use the default
  28. 'driver' => 'cookie',
  29. // check for an IP address match after loading the cookie (optional, default = false)
  30. 'match_ip' => false,
  31. // check for a user agent match after loading the cookie (optional, default = true)
  32. 'match_ua' => true,
  33. // cookie domain (optional, default = '')
  34. 'cookie_domain' => '',
  35. // cookie path (optional, default = '/')
  36. 'cookie_path' => '/',
  37. // cookie http_only flag (optional, default = use the cookie class default)
  38. 'cookie_http_only' => null,
  39. // whether or not to encrypt the session cookie (optional, default is true)
  40. 'encrypt_cookie' => true,
  41. // if true, the session expires when the browser is closed (optional, default = false)
  42. 'expire_on_close' => false,
  43. // session expiration time, <= 0 means 2 years! (optional, default = 2 hours)
  44. 'expiration_time' => 7200,
  45. // session ID rotation time (optional, default = 300)
  46. 'rotation_time' => 300,
  47. // default ID for flash variables (optional, default = 'flash')
  48. 'flash_id' => 'flash',
  49. // if false, expire flash values only after it's used (optional, default = true)
  50. 'flash_auto_expire' => true,
  51. // if true, a get_flash() automatically expires the flash data
  52. 'flash_expire_after_get' => true,
  53. // for requests that don't support cookies (i.e. flash), use this POST variable to pass the cookie to the session driver
  54. 'post_cookie_name' => '',
  55. /**
  56. * specific driver configurations. to override a global setting, just add it to the driver config with a different value
  57. */
  58. // special configuration settings for cookie based sessions
  59. 'cookie' => array(
  60. 'cookie_name' => 'fuelcid', // name of the session cookie for cookie based sessions
  61. ),
  62. // specific configuration settings for file based sessions
  63. 'file' => array(
  64. 'cookie_name' => 'fuelfid', // name of the session cookie for file based sessions
  65. 'path' => '/tmp', // path where the session files should be stored
  66. 'gc_probability' => 5 // probability % (between 0 and 100) for garbage collection
  67. ),
  68. // specific configuration settings for memcached based sessions
  69. 'memcached' => array(
  70. 'cookie_name' => 'fuelmid', // name of the session cookie for memcached based sessions
  71. 'servers' => array( // array of servers and portnumbers that run the memcached service
  72. 'default' => array('host' => '127.0.0.1', 'port' => 11211, 'weight' => 100)
  73. ),
  74. ),
  75. // specific configuration settings for database based sessions
  76. 'db' => array(
  77. 'cookie_name' => 'fueldid', // name of the session cookie for database based sessions
  78. 'database' => null, // name of the database name (as configured in config/db.php)
  79. 'table' => 'sessions', // name of the sessions table
  80. 'gc_probability' => 5 // probability % (between 0 and 100) for garbage collection
  81. ),
  82. // specific configuration settings for redis based sessions
  83. 'redis' => array(
  84. 'cookie_name' => 'fuelrid', // name of the session cookie for redis based sessions
  85. 'database' => 'default' // name of the redis database to use (as configured in config/db.php)
  86. )
  87. );