View Full Version : How to make PHPSESSID not show?
MTsoul
December 26th, 2004, 04:13 PM
Hey everyone,
I have a php page, and sometimes when i visit it, there are ?PHPSESSID=23908429347239857230587439857 things after all the links. How do I get rid of that so that every link is just "test.php" instead of "test.php?PHPSESSID=########"?
Thanks
TheDutch
December 27th, 2004, 06:33 AM
You can turn this of in the php.ini file :).
Hans Kilian
December 27th, 2004, 04:06 PM
Maybe a call to session_destroy() will get rid of it.
MTsoul
December 27th, 2004, 06:24 PM
I am hosted on a hosting company's computer, so I don't have access to the php.ini file. I also use sessions in my code, but just don't want the sessionid to appear in the title bar.
Any more ideas?
Hans Kilian
December 27th, 2004, 07:16 PM
If you use sessions then PHP needs to store the session ID somewhere. It can either use a cookie or put the PHPSESSID in the generated URLs. Are cookies enabled in your browser?
If they are and it still doesn't work, then you could try using
ini_set('session.use_cookies', '1');
ini_set('session.use_trans_sid', '0');
but that requires PHP 4 or better.
MTsoul
December 27th, 2004, 09:37 PM
I added both of those lines to the head of my page. It still doesn't work. Those ?PHPSESSID things only appear on the first visit of the page. After the session has been set, no more of those appear after links.
:(
TheDutch
December 28th, 2004, 10:24 AM
This should work a 100%: ini_set('session.use_trans_sid', false);
MTsoul
December 28th, 2004, 05:57 PM
Still isn't working :(
The page is www.mtsix.com - the links on top and right always have the sessid things only for the first time you visit the page.
Hans Kilian
December 29th, 2004, 11:01 AM
Is the ini_set call the very first statement in your php script (also before any HTML)? That's just about the only thing I can think about that would cause it not to work...
MTsoul
December 29th, 2004, 11:35 PM
Yeah those are right after the <? tag, before all html. It still does not work :(
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.