Anonymous users support vs Google bot

Posted by Andy on Stack Overflow See other posts from Stack Overflow or by Andy
Published on 2010-05-12T17:29:52Z Indexed on 2010/05/12 17:34 UTC
Read the original article Hit count: 214

Filed under:
|
|

I have a User class in my web app that represents a user currently logged in. Every time a user vists a page, a User instance is populated based on authentication data supplied in cookies.

A User instance is created even if an anonymous user logs in - and a corresponding new record is created in the User table in the database.

This approach allows me to save some state info for the current user regardless of its type.

The problem however with this approach is the Google bot, and other non-human web organisms crawling my pages. Every time a bot starts to walk around the site, thousands of useless records will be created in the database, each of them only to be used for a single page.

Question: what is the best trade off? How to support anonymous users, save their state, and don't get too much overhead because of cookieless bots?

© Stack Overflow or respective owner

Related posts about authentication

Related posts about users