irwan

disappear session IDs in your URLs.

Nov 20th, 2011
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.48 KB | None | 0 0
  1. with .htaccess
  2.  
  3. php_value session.use_trans_sid 0
  4. php_value session.use_only_cookies 1
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11. or add in index.php
  12.  
  13. if (isset($_GET['PHPSESSID'])) {
  14. $requesturi = preg_replace('/?PHPSESSID=[^&]+/',"",$_SERVER['REQUEST_URI']);
  15. $requesturi = preg_replace('/&PHPSESSID=[^&]+/',"",$requesturi);
  16. header("HTTP/1.1 301 Moved Permanently");
  17. header("Location: http://".$_SERVER['HTTP_HOST'].$requesturi);
  18. exit;
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25. or add in index.php
  26. ini_set("url_rewriter.tags","");
  27.  
  28.  
  29.  
  30.  
  31.  
Advertisement
Add Comment
Please, Sign In to add comment