Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7017837
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:57:58+00:00 2026-05-27T22:57:58+00:00

This is my setup: user.rb acts_as_authentic do |c| c.logged_in_timeout(1.minutes) end user_session.rb def to_key new_record?

  • 0

This is my setup:

user.rb

  acts_as_authentic do |c|
    c.logged_in_timeout(1.minutes)
  end

user_session.rb

  def to_key
    new_record? ? nil : [ self.send(self.class.primary_key) ]
  end
  self.logout_on_timeout = true

application_controller.rb

  helper_method :current_user_session, :current_user

  private
    def current_user_session
      logger.debug "ApplicationController::current_user_session"
      return @current_user_session if defined?(@current_user_session)
      @current_user_session = UserSession.find
    end

    def current_user
      logger.debug "ApplicationController::current_user"
      return @current_user if defined?(@current_user)
      @current_user = current_user_session && current_user_session.user
    end

    def require_user
      logger.debug "ApplicationController::require_user"
      unless current_user
        #store_location
        flash[:warning] = "You must be logged in to access this page"
        #redirect_to new_user_session_url
        redirect_to root_url
        return false
      end
    end

    def require_no_user
      logger.debug "ApplicationController::require_no_user"
      if current_user
        #store_location
        flash[:warning] = "You must be logged out to access this page"
        redirect_to account_url
        return false
      end
    end

But when I load my page, I will get the error

undefined method `logged_out?' for #<User:0x00000103ee8348>

I try to read the official GitHub page of Authlogic, but I still don’t know, what I miss… Could anyone give me a tip for fix it?

Many thanks in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T22:57:59+00:00Added an answer on May 27, 2026 at 10:57 pm

    I was having the exact same problem, and it boiled down to the fact I didn’t have all of the necessary columns in my User model.

    My original User model (from db/schema.rb) was pretty minimalistic:

    create_table "users", :force => true do |t|
        t.string   "username"
        t.string   "name"
        t.string   "crypted_password"
        t.string   "password_salt"
        t.string   "persistence_token"
        t.string   "perm",               :default => "employee"
    end
    

    However, I added the column t.datetime :last_requested_at to my model, as well as a few others that may or may not be needed. My final User model looks like:

    create_table "users", :force => true do |t|
        t.string   "username"
        t.string   "name"
        t.string   "crypted_password"
        t.string   "password_salt"
        t.string   "persistence_token"
        t.string   "perm",               :default => "employee"
        t.datetime "created_at"
        t.datetime "updated_at"
        t.integer  "login_count",        :default => 0,          :null => false
        t.integer  "failed_login_count", :default => 0,          :null => false
        t.datetime "last_request_at"
        t.datetime "current_login_at"
        t.datetime "last_login_at"
        t.string   "current_login_ip"
        t.string   "last_login_ip"
    end
    

    After adding in the other columns, I no longer get the undefined method 'logged_out?'... error.

    Good luck!

    (reference/more info: http://www.michaelhamrah.com/blog/2009/05/authlogic-and-openid-on-rails/ — search in the page for logged_out?, the explanation was about 3/4 of the way down the post.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this test case def setUp(self): self.user = User.objects.create(username=tauri, password='gaul') def test_loginin_student_control_panel(self): c
I have this setup: class UsersController < InheritedResources::Base respond_to :html, :js, :xml, :json def
I have this setup class User { Date lastLogin // logins is a history
this is my setup <div id=uxcParent> <div id=uxcClickable></div> </div> now when a user clicks
I have a two models set up like this: class User < ActiveRecord::Base #
I have this setup in my models: class Author(models.Model): name = models.CharField(max_length=100) class Topic(models.Model):
I have this setup in Phpmyadmin: USER HOST PASSW PRIVILEGES GRANT debian-sys-maint localhost Yes
Given this setup: var ObjectNamespace = {} var FunctionNamespace = function FunctionNamespace() {} ObjectNamespace.User
Having my db setup like this (type is always User although I have different
I have this setup right now... RewriteRule ^/?user userpanel.php RewriteRule ^/?user/?newListing newListing.php The above

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.