PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
idotcom
Forum Commoner
Posts: 69 Joined: Thu Mar 04, 2004 9:24 pm
Post
by idotcom » Sun Mar 05, 2006 11:19 am
Hi
How do I keep my session id's out of urls when bots come to my site?
Every time a robot comes to spider my site, the are given urls with the PHPSESSIONID=VALE
I'm sick of it. It appends to every url. And all my SERPS have stupid session id's in them.
I'd greatly appreciate a solution to this.
Thank you
idotcom
Forum Commoner
Posts: 69 Joined: Thu Mar 04, 2004 9:24 pm
Post
by idotcom » Sun Mar 05, 2006 12:57 pm
Hi
Thanks for youre reply.
I tried:
Code: Select all
ini_set("url_rewriter.tags","");
ini_set("session.use_trans_sid", false);
And just a little bit ago msnbot came and still had session id in the url.
This is annoying... why would PHP allow this?
Any other ideas?
Thanks
Benjamin
Site Administrator
Posts: 6935 Joined: Sun May 19, 2002 10:24 pm
Post
by Benjamin » Sun Mar 05, 2006 2:21 pm
You can turn it off in an .htaccess file. I don't know the syntax offhand.
eyespark
Forum Commoner
Posts: 50 Joined: Tue Jan 24, 2006 7:36 am
Post
by eyespark » Sun Mar 05, 2006 3:28 pm
htaccess
php_flag session.use_trans_sid off
idotcom
Forum Commoner
Posts: 69 Joined: Thu Mar 04, 2004 9:24 pm
Post
by idotcom » Sun Mar 05, 2006 4:32 pm
Thanks,
I tried that in htaccess too.
I emailed my host because everything I tried did not work.
I even tried this in htaccess: php_value session.use_trans_sid 0
AKA Panama Jack
Forum Regular
Posts: 878 Joined: Mon Nov 14, 2005 4:21 pm
Post
by AKA Panama Jack » Sun Mar 05, 2006 6:07 pm
idotcom wrote: Hi
Thanks for youre reply.
I tried:
Code: Select all
ini_set("url_rewriter.tags","");
ini_set("session.use_trans_sid", false);
And just a little bit ago msnbot came and still had session id in the url.
This is annoying... why would PHP allow this?
Any other ideas?
Thanks
You have to make sure the ini_set("session.use_trans_sid", false); is before the session_start();. If it isn't then you will still get the session ids in the url.
josh
DevNet Master
Posts: 4872 Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida
Post
by josh » Sun Mar 05, 2006 6:39 pm
"you need to enable session.use_only_cookies. In that case, cookies must be enabled unconditionally on the user side, or sessions will not work."
http://us3.php.net/session