]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - inc/3rdparty/Session.class.php
updated site_config
[github/wallabag/wallabag.git] / inc / 3rdparty / Session.class.php
index 59dfbe67009dd6bf7f09163f3c6eb34782ccb781..b56e4c545b23fa815d53c63b7c8e2a66e33cd0b7 100644 (file)
@@ -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;
+    }
 }