Module: UrlSession::Controller

Defined in:
lib/url_session/controller.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



2
3
4
# File 'lib/url_session/controller.rb', line 2

def self.included(base)
  base.send :before_filter, :set_session_id
end

Instance Method Details

#reset_sessionObject



15
16
17
18
# File 'lib/url_session/controller.rb', line 15

def reset_session
  super
  set_session_id
end

#url_optionsObject



6
7
8
9
10
11
12
13
# File 'lib/url_session/controller.rb', line 6

def url_options
  options     = Rails.application.config.session_options
  key         = options[:key]             || '_session_id'
  param       = options[:param]           || 'session_id'
  cookie      = !options[:cookie_enabled] || cookies[key].blank?
  session_id  = request.session_options[:id]
  { param.to_sym => cookie.presence && session_id }.merge super
end