lib/login_system.rb
# cookie and log the user back in if apropriate
cookie and log the user back in if apropriate
cookie and log the user back in if apropriate
def login_from_cookie
     return unless cookies[:auth_token]
     user = User.find_by_remember_token(cookies[:auth_token])
     if user && user.remember_token?
       user.remember_me
       self.logged_in_user = user
       cookies[:auth_token] = { :value => self.logged_in_user.remember_token , 
         :expires => self.logged_in_user.remember_token_expires_at }
     end
   end
def login_from_cookie return unless cookies [ :auth_token ] user = User . find_by_remember_token ( cookies [ :auth_token ] ) if user && user . remember_token? user . remember_me self . logged_in_user = user cookies [ :auth_token ] = { :value => self . logged_in_user . remember_token , :expires => self . logged_in_user . remember_token_expires_at } end end
cookie and log the user back in if apropriate
cookie and log the user back in if apropriate