user is logged in, they click the logout button, which fires the action
method Sessions#destroy and the view. The problem i’m having is that
even tho the session is deleted, the first go round it still displays
logged in. If you refresh it then says not logged in. I am not sure how
to even begin debugging this. thanks!
class SessionsController < ApplicationController
session[:user_id] = @current_id = nil
<% if @current_user %>
Logged in as: <%= @current_user.login %>
<%= link_to ‘Logout’, session_path, :method => :delete %>
<% else %>
Not logged in.
<%= link_to ‘Login’, new_session_path %>
<% end %>