peili
(Leet)
April 18, 2012, 12:00pm
1
Hi,
i am using CDbHttpSession, so my sessions are stored in the database.
Unfortunately there is a lot of crawler/bot traffic on my website.
Yii opens for every request a new session, if cookies are not enabled at the client side.
This leads to huge database overload.
Is there a way to stop starting sessions, if cookies are not enabled?
(It takes now 12 hours to blast my Memory table with 16MB Limit)
Best regards,
peili
zhuzhu
(Zhuzhu)
April 18, 2012, 1:17pm
2
peili:
Hi,
i am using CDbHttpSession, so my sessions are stored in the database.
Unfortunately there is a lot of crawler/bot traffic on my website.
Yii opens for every request a new session, if cookies are not enabled at the client side.
This leads to huge database overload.
Is there a way to stop starting sessions, if cookies are not enabled?
(It takes now 12 hours to blast my Memory table with 16MB Limit)
Best regards,
peili
I found same proble today!
trejder
(Tomasz)
April 19, 2012, 3:15pm
4
Sessions are generally handled by PHP (server side) and cookies by browser (client side). Sure there are options / solutions to make one available on other side, but because in general these are two different sides of request handling procedure, I would assume that doing, what you’re asking for will be very hard, if not impossible.
Did you try simple "robots.txt" solutions?
http://en.wikipedia …andard#Examples
http://en.wikipedia.org/robots.txt
It nearly always helps my sites to reduce unwanted traffic.
Just put:
User-agent: *
Disallow: /
to robots.txt file and place it in root of your site. Should help.
Or read above examples (or google for more) to get a more sophisticated solution.
Cheers,
Trejder