Thanks for your inputs,
Kevin ......... The plugin seems to be the best shoot for this issue, especially the IP based check will help, but I'll have to hunt for one that works in rails 1.2.3
If instead of a session expire time you are actually concerned about the number of useless session objects that get stored in your database by search engines there are a couple of options...
First, check out the build in rake tasks for sessions:
bq. ~/: rake -T | grep session rake db:sessions:clear # Clear the sessions table rake db:sessions:create # Creates a sessions migration for use with ActiveRecord::SessionStore rake tmp:clear # Clear session, cache, and socket files from tmp/ rake tmp:create # Creates tmp directories for sessions, cache, sockets, and pids rake tmp:sessions:clear # Clears all files in tmp/sessions
Second, there are plugins out there that can make the database-backed session store more intelligent. "limited_sessions":http://iprog.com/project/limited_sessions is one such plugin, I'm sure there are more out there.
Balaji, does it mean you want to provide session expire time for your rails application? if so you can do it by adding a method with before filter in application.rb file.
prepend_before_filter :prepare_session def prepare_session
if !session[:expiry_time].nil? and session[:expiry_time] < Time.now reset_session end session[:expiry_time] = "set time to expire"
by mentioning specific time to expire the session, you do it.
Thank You, Uma.
I have an ecommerce site,
recently am having issues with clearing session objects dumped by search robots. Collectively they constitute about 60% of the total user sessions created.
I need an effective way to handle this. Would having session expire time settings help?
I am using Rails 1.2.3