Cookies and bots

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
piwanek
Forum Newbie
Posts: 4
Joined: Sat Nov 25, 2006 3:04 pm

Cookies and bots

Post by piwanek »

Hi guys.

I'm guessing this is the wrong forum to ask this question. If so I sincerely apologize.

I have a question about cookies and bots and how to work around it.

We recently built a site which has a disclaimer page that sets a cookie to enter the site. Unfortunately it seems Google and all the others aren't getting past that page.

Is there an easy way to work around this? The site is built in php. Has anyone run into the same problem and if so, how did you solve it?
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

Sniff Google's user-agent and let that bypass the cookie. Not ideal though...

You could also try getting rid of the cookie idea altogether: index.html is the disclaimer, index2.html is the actual front page, etc.
piwanek
Forum Newbie
Posts: 4
Joined: Sat Nov 25, 2006 3:04 pm

Post by piwanek »

Unfortunately that doesn't work, since its all php and the index.php controls the whole site.
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

Right. So take off the cookie protection, and make the "home" page the disclaimer page.
piwanek
Forum Newbie
Posts: 4
Joined: Sat Nov 25, 2006 3:04 pm

Post by piwanek »

Unfortunately the disclaimer has a specific purpose, so it needs to be there.

I think we have taken care of it. According to Google WebMasters site, if you can browse the site in a text browser indexing should be fine. We have fixed the issues at hand and hopefully indexing should be no problem now.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

So if your users don't have javascript enabled they can't use your site?
User avatar
aaronhall
DevNet Resident
Posts: 1040
Joined: Tue Aug 13, 2002 5:10 pm
Location: Back in Phoenix, missing the microbrews
Contact:

Post by aaronhall »

Everah wrote:So if your users don't have javascript enabled they can't use your site?
Cookies* :wink:
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Sorry, I asked that question in a different way than it sounded in my head... :oops:

What I meant was that if a user chooses to not accept cookies, then they cannot use the site.
piwanek
Forum Newbie
Posts: 4
Joined: Sat Nov 25, 2006 3:04 pm

Post by piwanek »

We decided to remove the cookie all together.
User avatar
bokehman
Forum Regular
Posts: 509
Joined: Wed May 11, 2005 2:33 am
Location: Alicante (Spain)

Post by bokehman »

Ambush Commander wrote:Sniff Google's user-agent and let that bypass the cookie.
Sites that serve google content different from that it serves other user agents will be delisted if google finds out.
User avatar
Mordred
DevNet Resident
Posts: 1579
Joined: Sun Sep 03, 2006 5:19 am
Location: Sofia, Bulgaria

Post by Mordred »

piwanek wrote:Unfortunately the disclaimer has a specific purpose, so it needs to be there.
How do you plan on making GoogleBot agree to the disclaimer then? :)
piwanek wrote:We decided to remove the cookie all together.
That, or allow cookie-less browsing. Session ID-s can be propagated in the URLs for example.
Post Reply