app/controllers/sessions_controller.rb
# The Devise sign_out method deletes the entire session. We need the session
# :previous_url in order to friendly redirect back to the page the user was
# on when they were signing out.
# DELETE /resource/sign_out
The Devise sign_out method deletes the entire session. We need the session
:previous_url in order to friendly redirect back to the page the user was
on when they were signing out.
The Devise sign_out method deletes the entire session . We need the session : previous_url in order to friendly redirect back to the page the user was on when they were signing out .
def destroy
    clinic = session[:clinic]
    previous_url = session[:previous_external_url] 
    signed_out = (Devise.sign_out_all_scopes ? sign_out : sign_out(resource_name))
    session[:previous_external_url] = previous_url 
    session[:clinic] = clinic
    set_flash_message :notice, :signed_out if signed_out && is_flashing_format?
    yield if block_given?
    respond_to_on_destroy
  end
def destroy clinic = session [ :clinic ] previous_url = session [ :previous_external_url ] signed_out = ( Devise . sign_out_all_scopes ? sign_out : sign_out ( resource_name ) ) session [ :previous_external_url ] = previous_url session [ :clinic ] = clinic set_flash_message :notice , :signed_out if signed_out && is_flashing_format? yield if block_given? respond_to_on_destroy end
The Devise sign_out method deletes the entire session.
The Devise sign_out method deletes the entire session .
# Temporarily store previous_url # Restore previous_url to session