module ActionCable::Connection::PersistentSession

Public Instance Methods

build_rack_request() click to toggle source
Calls superclass method
# File lib/anycable/rails/actioncable/connection/persistent_session.rb, line 14
def build_rack_request
  return super unless socket.session

  super.tap do |req|
    req.env[::Rack::RACK_SESSION] =
      AnyCable::Rails::SessionProxy.new(req.env[::Rack::RACK_SESSION], socket.session)
  end
end
commit_session!() click to toggle source
# File lib/anycable/rails/actioncable/connection/persistent_session.rb, line 23
def commit_session!
  return unless request_loaded? && request.session.respond_to?(:loaded?) && request.session.loaded?

  socket.session = request.session.to_json
end
handle_channel_command(*) click to toggle source
Calls superclass method
# File lib/anycable/rails/actioncable/connection/persistent_session.rb, line 10
def handle_channel_command(*)
  super.tap { commit_session! }
end
handle_open() click to toggle source
Calls superclass method
# File lib/anycable/rails/actioncable/connection/persistent_session.rb, line 6
def handle_open
  super.tap { commit_session! }
end