Page 1 of 1

Remove SessionID from URL string

Posted: Sun Sep 25, 2005 12:49 am
by blacksnday
I have noticed a problem that looks horrible.
On my site for some reason, when you first enter and click any link,
the SessionID wants to be attatched. then after the first click, it goes away.

This is causing many problems with Search Engines.
As for security, thats not a problem yet as I dont offer any type of
membership system.

Is there a way to remove the Session ID from showing upon entry to site?

You can see the problem by doing a MSN search of my site.
All of MSN attatches a SessionID to the indexing....
http://search.msn.com/results.aspx?FORM ... shmyex.com
and i think its causing Google to not crawl anymore.

Posted: Sun Sep 25, 2005 3:14 am
by anjanesh
On your host, is your session.auto_start set to On ?
Check using phpinfo()

Posted: Sun Sep 25, 2005 6:30 am
by Weirdan
set
session.use_cookies=1
and
session.use_only_cookies=1

this way you will still be able to use sessions, but no SID will appear in your urls

Posted: Sun Sep 25, 2005 8:20 am
by Nathaniel
Use ini_set() to set Weirdan's config values.

Posted: Sun Sep 25, 2005 9:41 am
by pilau
Is SessionID presents using GET on URLs as a default?

Posted: Sun Sep 25, 2005 9:59 am
by feyd
pilau wrote:Is SessionID presents using GET on URLs as a default?
typically, yes.

Posted: Sun Sep 25, 2005 3:24 pm
by blacksnday
Weirdan wrote:set
session.use_cookies=1
and
session.use_only_cookies=1

this way you will still be able to use sessions, but no SID will appear in your urls
I checked and both are on as a local value.

With session.auto_start set to ON
would that mean that I wouldnt need to use

Code: Select all

session_start();
in scripts?

I would think I still would and should use it, just wanted to
clarify a bit.

Posted: Sun Sep 25, 2005 3:30 pm
by feyd
with auto_start on, session_start() is called just prior to starting the script on all affected files. This behaviour may not be wanted in many cases, so it's suggested to not have it on.

Posted: Sun Sep 25, 2005 8:33 pm
by blacksnday
I found that if I use full url paths for any link within the site, then
the Session ID problem goes away.

Posted: Mon Sep 26, 2005 1:58 am
by Weirdan
blacksnday wrote:I found that if I use full url paths for any link within the site, then
the Session ID problem goes away.
It's beacause url rewriter considers full urls to be external links.