Rev 555 | Rev 625 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 555 | Rev 557 | ||
---|---|---|---|
Line 290... | Line 290... | ||
290 | return $m[2]; |
290 | return $m[2]; |
291 | } |
291 | } |
292 | } |
292 | } |
293 | return false; |
293 | return false; |
294 | } |
294 | } |
295 | - | ||
296 | function op_setcookie($name, $value, $expires=0, $allowJS=false) { |
- | |
297 | // $path = ini_get('session.cookie_path'); |
- | |
298 | $path = OIDplus::webpath(null,true); |
- | |
299 | if (empty($path)) $path = '/'; |
- | |
300 | - | ||
301 | $domain = ''; |
- | |
302 | $secure = false; |
- | |
303 | $httponly = !$allowJS; |
- | |
304 | $samesite = 'Strict'; |
- | |
305 | - | ||
306 | if (strnatcmp(phpversion(),'7.3.0') >= 0) { |
- | |
307 | $options = array( |
- | |
308 | "expires" => $expires, |
- | |
309 | "path" => $path, |
- | |
310 | "domain" => $domain, |
- | |
311 | "secure" => $secure, |
- | |
312 | "httponly" => $httponly, |
- | |
313 | "samesite" => $samesite |
- | |
314 | ); |
- | |
315 | setcookie($name, $value, $options); |
- | |
316 | } else { |
- | |
317 | setcookie($name, $value, $expires, $path.'; samesite='.$samesite, $domain, $secure, $httponly); |
- | |
318 | } |
- | |
319 | } |
- | |
320 | 295 |