Want to remove pmsession from inner page URLs when home page is first loaded


I have a one question for php.

One of my client websites is made in php along CMS. Whenever the site (home page) is first loaded, it shows pmsession in the inner page URLs. After that it is disappeared.

Example of inner page URL:

I want to disappear it (i.e. http://www.xya.com/keyword-keyword) when the site (i.e. http://www.xya.com) is first loaded. I have found the below mentioned solutions for this problem.

  1. In your config.php file, put the following code:


ini_set(‘session.use_trans_sid’, 0);

ini_set(‘session.use_only_cookies’, 1);


  1. In your .htaccess file, use the code below:

php_flag session.use_trans_sid off

php_flag session.use_only_cookies on

Is it appropriate to use one of them?

If you have other suggestion, please suggest here.

Welcome to SitePoint Forums :slight_smile:

Well you could adjust php.ini directly if you have access to it, which would fix it as well (perminantly for all pages on that server. Call this Method 3).

But yes, basically what these two (now 3) methods are doing is the same thing, but on different levels: 1: The individual site (Runtime setting), 2: the whole server (Runtime setting), and 3: the whole server (Configuration setting).
Very few sites actually use trans_SID’s anymore, as cookies have become accepted and not just treated as spam objects.

Would I need to add or modify something in php.ini to solve this issue ?

the settings should be in there - look for session.use_trans_sid and session.use_only_cookies


Thanks for your support. let me check in it.