Monday, October 29, 2007

Remove the PHPSESSID From URL

The last couple of days I have been trying to remove unsightly PHPSESSIDs from my URLs. Here's how one looked on google.com.

http://www.xxxxxx.com/details_xxxxxx__xxxxxxxxxxxxxx-.html?
PHPSESSID=976fc83764c21749f95e831xxx6a3bxx

I opened up the php.ini file in Notepad and changed the 1 to 0. I'll check later on to see if it worked.

session.use_trans_sid = 0

-----
You can also put this in your config file
ini_set('session.use_trans_sid', false);

You can also modify the .htaccess file but a lot of web hosts won't let you do this type of modification. I tried.
php_flag session.use_trans_sid off

No comments: