Forum Moderators: coopster

Message Too Old, No Replies

Do SE bots read and set themselves cookies set with php?

         

GreenLeaf

12:48 pm on Aug 25, 2004 (gmt 0)

10+ Year Member



Hi all!
Does anybody know if SE bots read and set themselves cookies set with php setcookie() function?
Thanks in advance.

jetboy_70

1:20 pm on Aug 25, 2004 (gmt 0)

10+ Year Member



No. Any functionality that relies solely on cookies will not be visible to spiders.

GreenLeaf

2:16 pm on Aug 25, 2004 (gmt 0)

10+ Year Member



And if i, for example, set setcookie('cookiename', 'cookievalue')
and then call $_COOKIE['cookiename'] in my code,
what will get SE spider as a value for $_COOKIE['cookiename']?
Thanks.

Lord Majestic

2:39 pm on Aug 25, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You won't get anything because cookie won't be send back to server - client (bot) will receive your request to set cookie, but will ignore it.

GreenLeaf

2:47 pm on Aug 25, 2004 (gmt 0)

10+ Year Member



And if i preset a cookie by setting a fake one ($_COOKIE['cookiename']='cookievalue') to get value on the first page load, will spider read this preset value?

Lord Majestic

2:55 pm on Aug 25, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Spiders should ignore cookies completely - cookies are based on voluntary cooperation of client to send them back to server for each subsequent request after the one that instructed client to use said cookies.

It might be easier if you just said what you are trying to achieve.

GreenLeaf

3:09 pm on Aug 25, 2004 (gmt 0)

10+ Year Member



I'm trying to write a script for banner display/click tracking on my site. And i need to set up several cookies to serve relevant banner for this particular client.
And i don't wont to track impressions and clicks from bots. So, if bots dont read cookie's values then i can set up a condition: if some cookie isn't set then do not track this click/impression.
Am i right? Or are there better ways to do it?

Lord Majestic

3:15 pm on Aug 25, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Or are there better ways to do it?

Ignore (dont increment link counter) all requests that have useragent known to be used by bots. I would not get into cookies because per spec cookie will only be returned to you (if its supported) for all requests after after the one that had cookie set command returned from server. This way you can't really count that a page was viewed by a bot only because there is no cookie submitted to you because it might be the very first request made by a legitimate browser.

Wilderness might have a more effective way how to deal with bots *grins*

GreenLeaf

3:26 pm on Aug 25, 2004 (gmt 0)

10+ Year Member



I made a research and found that if i set up my cookies like that:

$_COOKIE['cookiename']=$somevar;
setcookie('cookiename',$somevar,0,'/');

then the cookie's value IS available on the very first page load.
Is it Ok?

Lord Majestic

3:28 pm on Aug 25, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Its probably available because you set it yourself, it can not be used to determine if client supports cookies because client did not yet send cookies back to you (talking about session cookies here).

Check if you get automatic session cookie set by web or app server - then check log files (assuming you log cookies) and odds are you will see lots of page view without cookies set, even though session cookies should be set everytime request goes through without that cookie set. I explained why this happens (or so I believe) above.

GreenLeaf

3:34 pm on Aug 25, 2004 (gmt 0)

10+ Year Member



Oh, i see!
Thanks a lot!

By the way, are session cookies better than simple cookies?

Lord Majestic

3:42 pm on Aug 25, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



They are different and can or even should co-exist.

GreenLeaf

3:45 pm on Aug 25, 2004 (gmt 0)

10+ Year Member



I've read somewhere that session cookies can be harmful for SE indexing. Is it true?

Lord Majestic

3:59 pm on Aug 25, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Don't think so - session id's as part of URLs are not good however as they increase URLs space without increasing amount of unique content. Technically speaking it should be possible to filter duplicates based on checksums of pages they point to, but some websites (even mainstream B2C players in the UK!) will time your session out based on session id in your URL! Now that is a dead end for a spider and I am not suprised spiders try to avoid dynamic pages with lots of parameters.

GreenLeaf

4:11 pm on Aug 25, 2004 (gmt 0)

10+ Year Member



What is better for visitor language fixation - session cookie or simple cookie?