Skip to content

Commit

Permalink
improved Rack session backward compatiblity support
Browse files Browse the repository at this point in the history
  • Loading branch information
j1n6 committed Dec 13, 2013
1 parent 0599a30 commit a3a278b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/devise_cas_authenticatable/single_sign_out/rack.rb
Expand Up @@ -18,7 +18,14 @@ def call(env)
def store_session_id_for_cas_ticket(env)
request = Rack::Request.new(env)
session = request.session
session_id = request.session.id

if session.respond_to?(:id)
# Rack > 1.5
session_id = session.id
else
# Compatible with old Rack requests
session_id = env['rack.session.options'][:id]
end
cas_ticket_store = session[CAS_TICKET_STORE]

if cas_ticket_store
Expand Down

0 comments on commit a3a278b

Please sign in to comment.