Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?
- $file = __FILE__;
- if (empty($_COOKIE['PHPSESSID'])) {
- header('HTTP/1.0 403 Forbidden');
- $level = 'Security';
- $errorMessage = "[{$file}] [{$level}] Session cookie not passed".PHP_EOL;
- error_log($errorMessage);
- die();
- } else {
- session_id($_COOKIE['PHPSESSID']);
- }
- session_start([
- 'gc_maxlifetime' =>3600,
- 'use_strict_mode' =>1,
- 'use_only_cookies' =>1,
- 'cookie_lifetime' =>604800,
- 'cookie_secure' =>1,
- 'cookie_httponly' =>1
- ]);
- //'cookie_samesite' =>1 add in after php 7.3
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement