Forum Moderators: phranque

Message Too Old, No Replies

Session ID and Cookies

         

gsmith

5:12 pm on Aug 12, 2004 (gmt 0)

10+ Year Member



I've seen in other discussions that the inclusion of session ID in the query string can cause problems for robots attempting to index ones' site. I think that I also saw that the robots cannot use cookies. Why should this be? If the robot can identify which part of the query string is the session ID, then why should there be a problem? If I am correct that they don't use cookies, why not?

dmorison

5:26 pm on Aug 12, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



By including session IDs in a URL you are effectively giving the search engine a moving target.

The search engine wants to see a URL that is constant so that it can refer visitors to your site in the future; but if you change the URL on the fly through virtue of a session ID then it cannot do that.

It can and does work however; but a lot depends on how your web server [or application] handles expired sessions. This would happen when someone did a search which found your page and the search engine gave them the URL that it crawled ages ago containing a session ID. If the web server couldn't care less and just displayed the page there wouldn't be much of a problem, but what often happens is that the web server baulks at the invalid session ID and displays an error instead.

Because of this, the search engines shy away from URLs that look like they contain a session ID.

If the robot can identify which part of the query string is the session ID, then why should there be a problem

A robot cannot identify a session ID, it can only guess that something might be a session ID. This takes you back the point given above - why bother indexing something that may be a moving target.

If I am correct that they don't use cookies, why not?

There would be nothing stopping a robot using cookies; but there is not a lot of point. The reasons for using cookies are not relevant in the context of a search engine robot indexing web pages.

gsmith

6:29 pm on Aug 12, 2004 (gmt 0)

10+ Year Member



dmorison: Thanks for you most helpful explantion.

My question is now as follows: What if, in order to avoid search engine problems, I always put the session ID in a cookie (assuming the user allows it)? Do I understand correctly that the robot will never even relate to the cookie, and therefore I succeed on both fronts: Users get session data, and the search engine robot happily indexes away?

dmorison

6:46 pm on Aug 12, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Do I understand correctly that the robot will never even relate to the cookie, and therefore I succeed on both fronts: Users get session data, and the search engine robot happily indexes away?

Sounds good. Keep your URLs clean and constant and everything will be fine.

gsmith

6:56 pm on Aug 12, 2004 (gmt 0)

10+ Year Member



Thanks again!

raywood

2:05 pm on Aug 17, 2004 (gmt 0)

10+ Year Member



I just posted in another thread about using the session variable to page a datagrid. Now I'm worried about search engines again. Should I use the context instead of the session? I don't know what the context does to the url. Does it add info to the url that will cause search engine problems?

raywood

2:54 pm on Aug 19, 2004 (gmt 0)

10+ Year Member



Nevermind the question about context. It was too early in the morning. I was talking about the cache. I figured it out. If you want to store session info in the cache you need some kind of key to find it again. So you still need to put a key in the url.

JoeCamel

6:46 pm on Aug 30, 2004 (gmt 0)

10+ Year Member



I do not see why an application has to pass a session ID around in a querystring or a form. You can retrieve the session ID whenever you want without the need to pass them around, why bother doing it?

Mind explaining what kind of application you are writing?