Skip to content

Instantly share code, notes, and snippets.

@abscondment
Created October 29, 2010 06:59
Show Gist options
  • Save abscondment/653049 to your computer and use it in GitHub Desktop.
Save abscondment/653049 to your computer and use it in GitHub Desktop.
before_filter :toggle_session
def toggle_session
# Disable the session if we spy a bot (or it was
# disabled elsewhere), enable otherwise.
if @disable_session.nil?
@disable_session = UrbanspoonUtil.is_megatron?(request.user_agent)
end
OptionalSessionStore.disabled = @disable_session
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment