]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - inc/3rdparty/Session.class.php
Merge branch 'dev' of github.com:wallabag/wallabag into dev
[github/wallabag/wallabag.git] / inc / 3rdparty / Session.class.php
index 8c747558e989bd1c903ac89a9d94dc13a00dab8d..b56e4c545b23fa815d53c63b7c8e2a66e33cd0b7 100644 (file)
@@ -68,10 +68,10 @@ class Session
         }
 
         if ( $longlastingsession ) {
-            session_set_cookie_params(self::$longSessionTimeout, $cookiedir, $_SERVER['HTTP_HOST'], $ssl, true);
+            session_set_cookie_params(self::$longSessionTimeout, $cookiedir, null, $ssl, true);
         }
         else {
-            session_set_cookie_params(0, $cookiedir, $_SERVER['HTTP_HOST'], $ssl, true);
+            session_set_cookie_params(0, $cookiedir, null, $ssl, true);
         }
         //set server side valid session timeout
         //WARNING! this may not work in shared session environment. See http://www.php.net/manual/en/session.configuration.php#ini.session.gc-maxlifetime about min value: it can be set in any application
@@ -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;
+    }
 }