Knowledgebase

Home » Item #948

Session ID shows in SEO (search engine optimization) friendly URLs

Item: #948
Date: 2 Nov 2006
Applies to
v6

Question

I notice that search engine friendly URLs on my site include the session ID, for example:

http://www.cactushop.com/cs6/vX74lb17009/Meat/Burgers/c-1-14-1/

(where 'vX74lb17009') is my session ID

instead of

http://www.cactushop.com/cs6/Meat/Burgers/c-1-14-1/

Won't this affect the search engine friendliness of my site and result in Google and others indexing the same page multiple times as it gets a different session ID on each visit? It also adds extra length to the URL which can't help either.

Answer

As will be explained further on, the session code should not be seen by search engines, which should see URLs like the second example above. But first it's worth understanding a bit more about how sessions work in CactuShop v6.

CactuShop has three settings for tracking user sessions, set with the 'usecookies' config setting. The store owner sets globally which policy is used and it applies to all sessions.

The first option is 'yes', which means that user sessions are linked to the user with a cookie planted on their browser. Most users support temporary, per session cookies, so most users will be able to use the site. Because cookies are used to track sessions, there is no need for the session ID to be passed around in URLs and form fields.

The second option is 'no'. In this case, cookies are not used to track sessions; instead the session ID is passed around in URLs and form fields with each page the user goes to. Although this means that the few users who have their browser set to reject cookies can use the site, it also risks losing the session if the user trims a URL manually or a link added in a page somewhere does not include the session ID.

The recommended 'usecookies' setting is 'backup' which passes the session info around as if using cookieless sessions, but writes cookies as a backup. If a user trims session info, the system will be able to recover the ID by reverting to cookies since these will be supported by the vast majority of users.

Regarding the issue of the session ID and search engines; the CactuShop code checks the user agent and only writes the session code into the friendly URLs if it believes that it is a browser reading the page and not a search engine spider. It does this by looking for the following appearing in the USER AGENT:

"msie"
"gecko"
"netscape"
"opera"
"safari"

This should mean that cookieless sessions are supported for MS Internet Explorer, Firefox, Mozilla, Netscape, Opera, Safari. Users of other browsers (and search engine spiders) should not see the session information in the friendly URLs.

This does not mean that someone using an exotic browser not included above cannot use the site. Providing the site has the 'usecookies' setting set to 'backup' they will be able to use it providing they have cookies activated.

Can't find the answer you need? Click here to open a support ticket.

« Back