The simplest way to disable sessions in Rails is to use session :o ff (see ActionController::SessionManagement::ClassMethods).

session :o ff

To disable session suport only for a specific controller add session :o ff to that controller

class MyController < ApplicationController
    session :o ff
end

Written like that, sessions are disabled for all actions on this controller.

Like filters, you can specify :o nly and :except clauses to restrict subset. The following code will disable session for first_action and third_action, but not for second_action.

class MyController < ApplicationController
  session :o ff, :o nly %w(first_action third_action)

  def first_action
  end

  def second_action
  end

  def third_action
  end
end

Read the rest of this entry