summaryrefslogtreecommitdiffstats
path: root/lib/SimpleSAML
diff options
context:
space:
mode:
authorJaime Pérez <jaime.perez@uninett.no>2016-07-04 13:54:25 +0200
committerJaime Pérez <jaime.perez@uninett.no>2016-07-04 13:54:25 +0200
commit0c660fda14af1111075d9f49b9448d5665b37143 (patch)
tree7580a1601aa1c4415076a9663250365c91071092 /lib/SimpleSAML
parentbcd0ae9bfc9aa6b01502bc029284841f2ee35061 (diff)
downloadsimplesamlphp-0c660fda14af1111075d9f49b9448d5665b37143.zip
simplesamlphp-0c660fda14af1111075d9f49b9448d5665b37143.tar.gz
simplesamlphp-0c660fda14af1111075d9f49b9448d5665b37143.tar.bz2
Add error codes to the SimpleSAML\Error\CannotSetCookie exception.
This way we can discern why we couldn't set a cookie, and act accordingly.
Diffstat (limited to 'lib/SimpleSAML')
-rw-r--r--lib/SimpleSAML/Error/CannotSetCookie.php21
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/SimpleSAML/Error/CannotSetCookie.php b/lib/SimpleSAML/Error/CannotSetCookie.php
index 65b6ee8..31a25b0 100644
--- a/lib/SimpleSAML/Error/CannotSetCookie.php
+++ b/lib/SimpleSAML/Error/CannotSetCookie.php
@@ -12,4 +12,25 @@ namespace SimpleSAML\Error;
class CannotSetCookie extends \SimpleSAML_Error_Exception
{
+ /**
+ * The exception was thrown for unknown reasons.
+ *
+ * @var int
+ */
+ const UNKNOWN = 0;
+
+ /**
+ * The exception was due to the HTTP headers being already sent, and therefore we cannot send additional headers to
+ * set the cookie.
+ *
+ * @var int
+ */
+ const HEADERS_SENT = 1;
+
+ /**
+ * The exception was due to trying to set a secure cookie over an insecure channel.
+ *
+ * @var int
+ */
+ const SECURE_COOKIE = 2;
}