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 5838917
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T11:31:09+00:00 2026-05-22T11:31:09+00:00

I am messing about with KO3 and the auth module, I have logins working

  • 0

I am messing about with KO3 and the auth module, I have logins working quite well, but I have noticed that every time I refresh the page the login count for my user increments.

I am pretty sure it is coming from this section.

// Check if logged in
if ($this->auth->logged_in())
{
    // Pass user to view
    $this->view->user = $this->auth->get_user(); // Here?
}
else
{
    // Attempt auto login
    $this->auth->auto_login();

    // Check if logged in
    if ($this->auth->logged_in())
    {
        // Pass user to view
        $this->view->user = $this->auth->get_user();
    }
}

Now I am pretty sure it is the line where I pass the users object to the view. The line commented with // Here?.

I just wondered why this would increment the logins. I have checked out the source and all it is doing is reading the session variables.

EDIT

I thought I had this fixed after I had it explained to me. Apparently not. I am not pretty sure it is down to sessions, I have tried using the cookie and session classes from the GitHub repo but that made no difference.

I am not sure where to begin debugging this.

  • 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-22T11:31:10+00:00Added an answer on May 22, 2026 at 11:31 am

    You’re overseeing the fact that your whole else block is ambigous, because a single call to Auth_ORM::logged_in() causes the following:

    Auth_ORM::logged_in() 
    -> Auth_ORM::get_user() 
    -> Auth_ORM::auto_login()
    -> Auth_ORM::complete_login()
    -> Model_Auth_User::complete_login()
    

    So your code would practically do the same looking like this:

    // Check if logged in
    if ($this->auth->logged_in())
    {
        // Pass user to view
        $this->view->user = $this->auth->get_user();
    }
    

    And Model_Auth_User::complete_login() is where the logins count gets incremented.

    Your problem is that Auth_ORM::auto_login() is always called (either because of a PEBKAC or your session isn’t ok), setting a new token instead of saving the user object into session.

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

Sidebar

Related Questions

Well after much messing about I have finally got a query that gives sales
Messing about a bit, i have a working Adobe After Effects plugin with a
I have a tricky problem that I've been messing about with for a few
I have been messing with this code for quite some time, works in FF,
After messing about with F# there are some really nice features that I think
I'm messing about with controller organisation and I've hit a problem. If I have
OK I have been messing about with URL rewriting for the last few days
I have been messing about with google calendars and I think they have a
So I started messing around with gettext but I'm still puzzled about certain things,
I have a question about Javascript widgets. The widget I am working on simply

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.