Removing PHPSESSID from URL

I have my site hosted on dreamhost.

Whenever i disables cookies, PHPSESSID get added up in url.
I wanna remove PHPSESSID.

I tried many thing with .htaccess and my php config file as shown below.

.htaccess file

php_value session.use_only_cookies 1
php_value session.use_trans_sid 0

config.php file (included in all php files)

@ini_set(“session.use_cookies”, “1”);
@ini_set(“session.use_trans_sid”, “false”);

But problem is still same.

Do anyone have it’s solution?
Please help me.
Thanks in advance

Anoop kumar

first of all, if you get rid of PHPSESSID and have cookies off, sessions won’t work for you.

generally the .htaccess way of setting php values doesn’t work at dreamhost because php runs as cgi and not an apache module. the ini_set commands should work though – do you call them before session_start?

track7 - my dream-hosted site

I was calling ini_set at the top of code then i am calling session_start like this

@ini_set(“session.use_cookies”, “1”);
@ini_set(“session.use_trans_sid”, “false”);

@ini_set(‘session.save_handler’, ‘files’);

Anoop kumar

I got the solution for this problem.
I just have upgraded the PHP version from 4 to 5.2.3
By default in PHP 5.x.x
session.use_cookies = 1
session.use_trans_sid = false

So problem is solved now, But not for PHP 4 at dreamhost.
I hope anyone will provide its solution too.

Anoop kumar