dsmorey
dsmorey

Reputation: 473

Stop Rails from storing sessions during service calls

Rails 2.3.18

We have our main administration site and our web services in the same rails project. We just found that sessions are being created by both the administration web traffic and the service calls.

Is there a way to turn off the session storage for just the web service calls? They are not needed and it's just a waste of space.

Thank you

Upvotes: 0

Views: 41

Answers (1)

Rob
Rob

Reputation: 415

You can use the session off plugin to disable sessions for certain actions and controllers.

https://github.com/kares/session_off

Install it as a gem gem 'session_off' or as a plugin script/plugin install git://github.com/kares/session_off.git

You can disable sessions for all actions by calling session :off in the relevant controller(s):

class WebServiceController < ApplicationController
  session :off
end

Upvotes: 1

Related Questions