Revision: 2014
Author: olavmrk
Date: Wed Dec  2 03:51:44 2009
Log: Add code to detect whether the session cookie is set.
http://code.google.com/p/simplesamlphp/source/detail?r=2014

Modified:
  /trunk/lib/SimpleSAML/Session.php
  /trunk/lib/SimpleSAML/SessionHandler.php
  /trunk/lib/SimpleSAML/SessionHandlerCookie.php
  /trunk/lib/SimpleSAML/SessionHandlerPHP.php

=======================================
--- /trunk/lib/SimpleSAML/Session.php   Wed Nov  4 22:33:47 2009
+++ /trunk/lib/SimpleSAML/Session.php   Wed Dec  2 03:51:44 2009
@@ -939,6 +939,20 @@

                return $this->logoutState;
        }
+
+
+       /**
+        * Check whether the session cookie is set.
+        *
+        * This function will only return FALSE if is is certain that the 
cookie  
isn't set.
+        *
+        * @return bool  TRUE if it was set, FALSE if not.
+        */
+       public function hasSessionCookie() {
+
+               $sh = SimpleSAML_SessionHandler::getSessionHandler();
+               return $sh->hasSessionCookie();
+       }

  }

=======================================
--- /trunk/lib/SimpleSAML/SessionHandler.php    Mon Aug 17 02:03:58 2009
+++ /trunk/lib/SimpleSAML/SessionHandler.php    Wed Dec  2 03:51:44 2009
@@ -115,6 +115,20 @@
                /* Set the session handler. */
                self::$sessionHandler = $sh;
        }
+
+
+       /**
+        * Check whether the session cookie is set.
+        *
+        * This function will only return FALSE if is is certain that the 
cookie  
isn't set.
+        *
+        * @return bool  TRUE if it was set, FALSE if not.
+        */
+       public function hasSessionCookie() {
+
+               return TRUE;
+       }
+
  }

  ?>
=======================================
--- /trunk/lib/SimpleSAML/SessionHandlerCookie.php      Thu Jun 12 09:42:26 2008
+++ /trunk/lib/SimpleSAML/SessionHandlerCookie.php      Wed Dec  2 03:51:44 2009
@@ -117,6 +117,20 @@

                return TRUE;
        }
+
+
+       /**
+        * Check whether the session cookie is set.
+        *
+        * This function will only return FALSE if is is certain that the 
cookie  
isn't set.
+        *
+        * @return bool  TRUE if it was set, FALSE if not.
+        */
+       public function hasSessionCookie() {
+
+               return array_key_exists('SimpleSAMLSessionID', $_COOKIE);
+       }
+
  }

  ?>
=======================================
--- /trunk/lib/SimpleSAML/SessionHandlerPHP.php Fri Sep 25 02:53:47 2009
+++ /trunk/lib/SimpleSAML/SessionHandlerPHP.php Wed Dec  2 03:51:44 2009
@@ -93,6 +93,21 @@

                return $_SESSION[$key];
        }
+
+
+       /**
+        * Check whether the session cookie is set.
+        *
+        * This function will only return FALSE if is is certain that the 
cookie  
isn't set.
+        *
+        * @return bool  TRUE if it was set, FALSE if not.
+        */
+       public function hasSessionCookie() {
+
+               $cookieName = session_name();
+               return array_key_exists($cookieName, $_COOKIE);
+       }
+
  }

  ?>

--

You received this message because you are subscribed to the Google Groups 
"simpleSAMLphp commits" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/simplesamlphp-commits?hl=en.


Reply via email to