简体   繁体   中英

Hide PHP Session ID from URL and COOKIE

I would like to hide the PHPSESSID from the Cookies and also prevent it from being used in the URL as well. My purpose for this is to avoid hacking using the PHPSESSID variable. But I would want my PHP to still utilize sessions.

There are two ways to achieve this.

  1. .htaccess

php_flag session.use_trans_sid off

  1. php

ini_set('session.use_trans_sid', false);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM