Forum Moderators: open

Message Too Old, No Replies

Session id's?

         

JeremyL

11:11 pm on Mar 11, 2003 (gmt 0)

10+ Year Member



OK I have some pages that are php generated and use session cookies. Therefore the user never sees the SID in the url UNLESS they have cookies turned off. In that case the SID is automatically added to the url by php.

My question is, what happens to googlebot and other spiders when they come snatch my pages? Do they get the normal url or do they see the url with the session id's?

digitalghost

11:12 pm on Mar 11, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Googlebot won't accept cookies. As far as I know, no bots will accept cookies, they don't have any pockets to put them in. ;)

jatar_k

11:17 pm on Mar 11, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



I can say that our site uses transparent session ids and googlebot doesn't seem to see them, or at least knows enough to drop them from the url in the index.

They seem to cause no problems with indexing that I can make out, this is in my particular case.

<added>JeremyL straightened me out ;)

[edited by: jatar_k at 12:20 am (utc) on Mar. 12, 2003]

JeremyL

11:57 pm on Mar 11, 2003 (gmt 0)

10+ Year Member



I can say that our site uses transparent session ids and googlebot doesn't seem to see them, or at least knows enough to drop them from the url in the index.

Are you talking about your site in your profile? I checked and verified your site only uses session cookies and not normal cookies and if I turn my cookies off I cannot get a session from your site. But whats different is with my code if no session cookie is allowed the sid is put in the url automatically. With yours, even with cookies off the sid never goes to the url. May I ask how this was done? Do you have the "use cookies only" set in php.ini or did you find a local way of doing this? I can't touch the php.ini so I was wondering if there was another way to do what you did.

Thanks

jatar_k

12:19 am on Mar 12, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Interesting virtual slap in the head JeremyL ;)
Good point about the no id in the url.
The non secure doesn't site session isn't especially important so it is advantageous for the urls to stay spiderable. If cookies are turned off people cannot login though.

We have it set so
session.use_cookie = 1
session.use_trans_sid = 1

no entry for session.use_only_cookies

so it explicitly sets cookie only, keeps the id out of the url, interesting.

If the session is absolutely necessary then you would not be able to use this method.

JeremyL

12:38 am on Mar 12, 2003 (gmt 0)

10+ Year Member



Are you sure?

session.use_cookie = 1
Tells php to use cookies WHEN availible

session.use_trans_sid = 1
Tells it TO add the SID to the url if no cookie is availible. Are you sure yours isn't set to 0? It acts like it is.

And if you have session.use_only_cookies = 0 or no entry for it, then you should have the SID put in url if the other above 2 are true.

The main one here is session.use_trans_sid. if that is set to one, that is where php tells itself to take all your href's and add the sid to the url.

I couldn't find a local alternative to the php.ini way so I just set session.use_trans_sid = 0 and the url sid's went away.

jatar_k

2:08 am on Mar 12, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



yes, quite sure, I went through the php.ini to be sure ;)

It does seem a little strange but I checked through it all with an extra pair of eyes to be sure. If I have time I will go through some other settings and see if I can see anything else.