Disabling automatic session IDs in URLs

This sections will contains code regarding different PHP & MySQL features and contains help about php/mysql issues.

Disabling automatic session IDs in URLs

Postby MT Shahzad on March 12th, 2008, 3:12 pm

If the PHP is configured to automatically append the Session ID to any URLs. Eg - in php.ini, the variable session.use_trans_sid was set to 1. This means when each webpage loaded, the server scanned all hyperlinks in the HTML and automatically appended the session ID to the end of the linked to URL. Not only does put a strain on server performance, it also can render your pages unindexable by search engines. To disable it, I started my PHP pages with this code:

Code: Select all
ini_set("session.use_trans_sid", 0);
MT Shahzad
Web/Software Developer
http://mts.sw3solutions.com
User avatar
MT Shahzad
Site Admin
 
Posts: 300
Joined: February 29th, 2008, 8:11 am
Location: Muridke, Pakistan

Return to PHP / MySQL / XML

Who is online

Users browsing this forum: No registered users and 0 guests

cron