Session cookie prevents pages to load There is a problem with Drupal 6 site. It seems seesion cookie is preventing some pages to load.

Site has approximately 5 to 10 pages (out of 30 000) of difference content types which can't be loaded. No errors returned — browser's wheel turning endlessly. After disabling cookies pages load just normally. After some testing I can say, that the problem in session cookie.

The problem doesn't exist in the development environment. I have made some testing on production (stopped Nginx and restarted Apache as single web-server) to make it similar to to development environment, but nothing changed. Now I have no idea how to debug the problem.

Thanks for any pointers.

[Solution]

The problem was in big sessions table (2GB). After truncating the table error has gone.
On large sites with many users and many simultaneous connections keeping sessions in database will cause a problems. So there are some tricks that may help you:


Don't keep unneeded sessions for anonymous users. To do this, choose one of the following, from what I advise most, to what's easiest:

Upgrade to Drupal 7
Migrate to Pressflow
Use No Anonymous Sessions module

Move your sessions where they will do less damage:

Memcache API and Integration module allows sessions in memcached bin
Memcache Storage (possibly with Cache Backport) offers the same functionality
Create your own session module looking at code of the above, for example to keep sessions in shared memory or in files on a ramdisc.

Flush sessions every midnight (or other hour with no visitors)