We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 3256a7c + 232fceb commit 7cb875aCopy full SHA for 7cb875a
.gitignore
@@ -1,4 +1,5 @@
1
test
2
Experimental
3
vendor
4
-composer.lock
+composer.lock
5
+.idea
src/CSRF.php
@@ -18,7 +18,7 @@ class CSRF extends Anchor
18
19
/**
20
* Manage config for leaf anchor
21
- *
+ *
22
* @param array|null $config The config to set
23
*/
24
public static function config($config = null)
@@ -32,8 +32,10 @@ public static function config($config = null)
32
33
public static function init()
34
{
35
- session_start();
36
-
+ if (session_status() !== PHP_SESSION_ACTIVE) {
+ session_start();
37
+ }
38
+
39
if (!isset($_SESSION[static::$config["SECRET_KEY"]])) {
40
Session::set(static::$config["SECRET_KEY"], static::generateToken());
41
}
0 commit comments