In CPAN::Forum ( http://www.cpanforum.com/ ) ( source at http://svn.pti.co.il/svn/cpan-forum/trunk/ )
I am using CGI::Application::Plugin::Session
I encountered two issues, I hope you might be able to help:
1) I noticed that ocassionally the login and the logout processes don't succeed, that is, they run ok but the session data in the database (I am using SQLite as the repository for the session data) is not updated. More exactly I notice that the application thinks the login process went ok but then when I visit the page again the user is still not logged in.
Adding $session->flush() at the end of both the login and logut process seem to solve the problem but I thought this should be automatic.
(I am using CGI, not mod_perl)
2) I have the a $self->session_config call in cgiapp_init, setting a cookie for every visitor right when they visit. While this might be good for visitor tracking it actually adds quite a lot of rows in the database for people who don't really need session management as they don't log in.
To make the problem worse when the crawler of Google and friends come I think they don't send back the cookie they get so for every "page view" they generate they get a new cookie and a new row in the database. As CPAN::Forum had nearly 8000 pages when it was opened (for every CPAN distro there is a separate page) this meant that in just 6 weeks of operation I had more than 160,000 rows in the sessions table. Mostly useless entries.
My possible solutions are: 1) Recognize crawlers and not to give them cookies at all. 2) Give out cookies only when someone has logged in. (or registered ?) 3) Maintain some counter how many hits each cookie was used for and run some cleanup process and remove cookies that were used only once and are at least one day old.
Out of all of the above I'd like to know how to implement (2).
Can you give me any examples ?
Gabor
--------------------------------------------------------------------- Web Archive: http://www.mail-archive.com/[email protected]/ http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2 To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
