Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. <?
  2. $file = __FILE__;
  3. if (empty($_COOKIE['PHPSESSID'])) {
  4. header('HTTP/1.0 403 Forbidden');
  5. $level = 'Security';
  6. $errorMessage = "[{$file}] [{$level}] Session cookie not passed".PHP_EOL;
  7. error_log($errorMessage);
  8. die();
  9. } else {
  10. session_id($_COOKIE['PHPSESSID']);
  11. }
  12. session_start([
  13. 'gc_maxlifetime' =>3600,
  14. 'use_strict_mode' =>1,
  15. 'use_only_cookies' =>1,
  16. 'cookie_lifetime' =>604800,
  17. 'cookie_secure' =>1,
  18. 'cookie_httponly' =>1
  19. ]);
  20. //'cookie_samesite' =>1 add in after php 7.3
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement