diff options
author | Frédéric Guillot <fred@kanboard.net> | 2014-05-23 11:59:23 -0400 |
---|---|---|
committer | Frédéric Guillot <fred@kanboard.net> | 2014-05-23 11:59:23 -0400 |
commit | 14c2998c4ac0a56857014fb8b4d403b52dbc686e (patch) | |
tree | 0a31a1941f71b1db0863404243b101528058cfa9 /app/Core/Session.php | |
parent | db76bcb593e34948dab2709bcb7b6c1139a37c72 (diff) |
Improve css and phpdoc comments
Diffstat (limited to 'app/Core/Session.php')
-rw-r--r-- | app/Core/Session.php | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/app/Core/Session.php b/app/Core/Session.php index 0c3ec2d9..6ce1bd40 100644 --- a/app/Core/Session.php +++ b/app/Core/Session.php @@ -2,13 +2,33 @@ namespace Core; +/** + * Session class + * + * @package core + * @author Frederic Guillot + */ class Session { + /** + * Sesion lifetime + * + * @var integer + */ const SESSION_LIFETIME = 86400; // 1 day + /** + * Open a session + * + * @access public + * @param string $base_path Cookie path + * @param string $save_path Custom session save path + */ public function open($base_path = '/', $save_path = '') { - if ($save_path !== '') session_save_path($save_path); + if ($save_path !== '') { + session_save_path($save_path); + } // HttpOnly and secure flags for session cookie session_set_cookie_params( @@ -39,16 +59,33 @@ class Session } } + /** + * Destroy the session + * + * @access public + */ public function close() { session_destroy(); } + /** + * Register a flash message (success notification) + * + * @access public + * @param string $message Message + */ public function flash($message) { $_SESSION['flash_message'] = $message; } + /** + * Register a flash error message (error notification) + * + * @access public + * @param string $message Message + */ public function flashError($message) { $_SESSION['flash_error_message'] = $message; |