Advertisement
manman89

MỘT SỐ LƯU Ý VỀ HEADER CỦA PHP

Jun 6th, 2014
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. // Standardize the times & dates to UTC because people don't live in the same timezone as the server.
  2. date_default_timezone_set("UTC");
  3.  
  4. // HSTS header (force HTTPS)
  5. if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off' && $_SERVER['HTTP_HOST'] != "localhost" && $_SERVER['HTTP_HOST'] != "192.168.1.102"){
  6. header('Strict-Transport-Security: max-age=31536000'); /* one year */
  7. }
  8.  
  9. // Prevent pages from being displayed in iframes. Not supported by all browsers.
  10. header('X-Frame-Options: SAMEORIGIN');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement