X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=inc%2F3rdparty%2FSession.class.php;h=b56e4c545b23fa815d53c63b7c8e2a66e33cd0b7;hb=90a1a78b1e2f4d40e1d9b8e6f46aca129a9d7bcf;hp=59dfbe67009dd6bf7f09163f3c6eb34782ccb781;hpb=d619120fc45693b73d14e4f2c8b98fc5b5489b7c;p=github%2Fwallabag%2Fwallabag.git diff --git a/inc/3rdparty/Session.class.php b/inc/3rdparty/Session.class.php index 59dfbe67..b56e4c54 100644 --- a/inc/3rdparty/Session.class.php +++ b/inc/3rdparty/Session.class.php @@ -309,4 +309,38 @@ class Session return true; // User is not banned. } + + + /** + * Tells if a param exists in session + * + * @param $name name of the param to test + * @return bool + */ + public static function isInSession($name) + { + return (isset($_SESSION[$name]) ? : FALSE); + } + + /** + * Returns param in session + * + * @param $name name of the param to return + * @return mixed param or null + */ + public static function getParam($name) + { + return (self::isInSession($name) ? $_SESSION[$name] : NULL); + } + + /** + * Store value in session + * + * @param $name name of the variable to store + * @param $value value to store + */ + public static function setParam($name, $value) + { + $_SESSION[$name] = $value; + } }