|
1 | 1 | <?php
|
2 | 2 |
|
| 3 | + |
3 | 4 | setcookie($name, $value, $expire, $path, $domain, true, false); // Noncompliant {{Make sure creating this cookie without the "httpOnly" flag is safe here.}}
|
4 | 5 | //^^^^^^^^^ ^^^^^ <
|
5 | 6 | setrawcookie($name, $value, $expire, $path, $domain, true, false); // Noncompliant {{Make sure creating this cookie without the "httpOnly" flag is safe here.}}
|
|
13 | 14 | setcookie($name, $value, $expire, $path); // Noncompliant
|
14 | 15 | setcookie($name, $value); // Noncompliant
|
15 | 16 |
|
| 17 | + |
| 18 | +setcookie("tokenIdentity"); // Compliant; cookie value is empty by default |
| 19 | +setcookie("tokenIdentity", path:"/", value:'foo', expires_or_options:time() - 42000); // Compliant; cookie value is hardcoded |
| 20 | +setcookie(session_name(), '', time() - 3600, '/'); // Compliant; cookie value is hardcoded |
| 21 | +setcookie(session_name(), "", time() - 3600, '/'); // Compliant; cookie value is hardcoded |
| 22 | +\setcookie(\session_name(), null, -1, \OC::$WEBROOT ? : '/'); // Compliant; cookie value is null |
| 23 | +setcookie("tokenIdentity", 'foo', time() - 42000, "/"); // Compliant; cookie value is hardcoded |
| 24 | +setcookie("tokenIdentity", "foo", time() - 42000, "/"); // Compliant; cookie value is hardcoded |
| 25 | + |
| 26 | + |
16 | 27 | setrawcookie($name, $value, $expire, $path, $domain, true, foo(false));
|
17 | 28 | setrawcookie($name, $value, $expire, $path, $domain, true, true);
|
18 | 29 | setrawcookie($name, $value, $expire, $path, $domain, false); // Noncompliant
|
|
0 commit comments