Browse the Ruby on Rails Community.

You are here: Forums Ask a Rails expert Prevent session dumps from sea...

Replytotopic

Prevent session dumps from search robots

Posted in Forums : Ask a Rails expert

 
Jqtcungqf6beajq7tiof0w9zkslnxun9rjhvi-penjm?feat=directlink

Authority 12
Posting Rating 95
Sign in to rate this post

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

 
Mahesh_new_image

Authority 37
Posting Rating 94
Sign in to rate this post

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" 
 end

by mentioning specific time to expire the session, you do it.

Thank You,
Uma.

 
Profile

Authority 0
Posting Rating 79
Sign in to rate this post

Hi Balaji,

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:

~/: 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 is one such plugin, I’m sure there are more out there.

 
Jqtcungqf6beajq7tiof0w9zkslnxun9rjhvi-penjm?feat=directlink

Authority 12
Posting Rating 95
Sign in to rate this post

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

Replytotopic

Other Recent Topics

Ask a Rails expert : nested application ApplicationController get called intead of children::ApplicationController

Ask a Rails expert : Best way to structure a database for a large/static dataset

Ask a Rails expert : Ruby Developer (ROR) - Scottish based (Remote working from within the UK)

Ask a Rails expert : Above Ground Pool Supplies

Ask a Rails expert : How to get url params in observer or model in Rails 3.1

Ask a Rails expert : What can persuade you to hire Junior Ruby devs with significant PHP experience?

Ask a Rails expert : What industry value does the Ruby or Rails Certification currently have?

Ask a Rails expert : Louis Vuitton Damier Azur Canvas specially sale ( www.salecheaplouisvuitton.com )

Ask a Rails expert : ·How to check errors/puts statements from ruby files which are under cronob

Ask a Rails expert : Louis Vuitton cheap Soft Sided Luggagespecial offer( www.salecheaplouisvuitton.com )

Formatting Help
  • *bold*       _italics_      
    bq. (quotes)
  • "DSC":http://www.dsc.net
  • * or # (lists)
or cancel