session.php 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. <?php
  2. return
  3. [
  4. /**
  5. * ---------------------------------------------------------
  6. * Confifuration
  7. * ---------------------------------------------------------
  8. *
  9. * The configuration to use.
  10. */
  11. 'configuration' => 'file',
  12. /**
  13. * ---------------------------------------------------------
  14. * Session (cookie) name
  15. * ---------------------------------------------------------
  16. *
  17. * Using a unique session name will prevent session collisions with other applications.
  18. */
  19. 'session_name' => 'mako_session',
  20. /**
  21. * ---------------------------------------------------------
  22. * Time to live
  23. * ---------------------------------------------------------
  24. *
  25. * Set the time to live of session data and cookies in seconds.
  26. * Note that a time to live of 0 seconds for cookies mean that they
  27. * expire at the end of the session (when the browser closes).
  28. */
  29. 'ttl' =>
  30. [
  31. 'data' => 1800,
  32. 'cookie' => 0,
  33. ],
  34. /**
  35. * ---------------------------------------------------------
  36. * Cookie options
  37. * ---------------------------------------------------------
  38. */
  39. 'cookie_options' =>
  40. [
  41. /**
  42. * The path on the server in which the cookie will be available on.
  43. * If set to '/', the cookie will be available within the entire domain.
  44. * If set to '/foo/', the cookie will only be available within the /foo/ directory and all sub-directories.
  45. */
  46. 'path' => '/',
  47. /**
  48. * The domain that the cookie is available to.
  49. * To make the cookie available on all subdomains of example.org (including example.org itself) then you'd set it to '.example.org'.
  50. */
  51. 'domain' => '',
  52. /**
  53. * Indicates that the cookie should only be transmitted over a secure HTTPS connection from the client. When set to TRUE,
  54. * the cookie will only be set if a secure connection exists. On the server-side, it's on the programmer to send this kind of cookie
  55. * only on secure connection (e.g. with respect to $this->request->secure()).
  56. */
  57. 'secure' => false,
  58. /**
  59. * When TRUE the cookie will be made accessible only through the HTTP protocol.
  60. * This means that the cookie won't be accessible by scripting languages, such as JavaScript.
  61. * It has been suggested that this setting can effectively help to reduce identity theft through XSS attacks
  62. * (although it is not supported by all browsers), but that claim is often disputed.
  63. */
  64. 'httponly' => true,
  65. ],
  66. /**
  67. * ---------------------------------------------------------
  68. * Configurations
  69. * ---------------------------------------------------------
  70. *
  71. * You can define as many session configurations as you want.
  72. *
  73. * The supported session types are: "database", "file", "null" and "redis".
  74. *
  75. * type : Session type you want to use.
  76. * configuration: Database or redis configuration to use for sessions (only required when using "database" or "redis" sessions).
  77. * path : Save path for session files (only required when using "file" sessions).
  78. * table : Name of the database table (only required when using "database" sessions).
  79. */
  80. 'configurations' =>
  81. [
  82. 'database' =>
  83. [
  84. 'type' => 'database',
  85. 'configuration' => 'test',
  86. 'table' => 'mako_sessions',
  87. ],
  88. 'file' =>
  89. [
  90. 'type' => 'file',
  91. 'path' => MAKO_APPLICATION_PATH . '/storage/sessions',
  92. ],
  93. 'null' =>
  94. [
  95. 'type' => 'null',
  96. ],
  97. 'redis' =>
  98. [
  99. 'type' => 'redis',
  100. 'configuration' => 'session',
  101. ],
  102. ],
  103. ];