Welcome Guest, Not a member yet? Register   Sign In
Community Auth Issue
#10

(This post was last modified: 08-31-2017, 11:56 AM by skunkbad.)

Here's what's up. I created a library that does nothing other than load the session, and I autoloaded it in config/autoload.php. Here's the library I used:


PHP Code:
class Sessionhog {
    public function __construct()
    {
        $CI =& get_instance();
        $CI->load->library('session');
    }


 and autoloading in config/autoload.php:


PHP Code:
$autoload['libraries'] = array('sessionhog'); 


and yes, there was definitely an error:


Code:
Error Number: 1048
Column 'id' cannot be null
INSERT INTO `auth_sessions` (`id`, `user_id`, `login_time`, `ip_address`, `user_agent`) VALUES (NULL, '412049668', '2017-08-31 10:57:57', '127.0.0.1', 'Firefox 55.0 on Linux')
Filename: third_party/community_auth/models/Auth_model.php
Line Number: 90

So, it turns out that all you need to do to fix that is set the Community Auth package path in config/autoload.php


PHP Code:
$autoload['packages'] = array(APPPATH 'third_party/community_auth/'); 

One thing I noticed was that after the error, I had to go into the database and delete the sessions before I could login again. Same might be true if I had just deleted browser cookies, but I didn't try that.

So just try to autoload the community auth package path, and I think you should be good. Report back please.

I have a feeling that the problem is that your library sets up the session before MY_Session can be loaded (because there is no package path to it), so the important session ID is never passed back (because the method was not overridden), resulting in NULL.

You might be asking why I'm even doing these session modifications in the first place, right? Well, it's because some people aren't going to use database sessions, and there has to be a way to match a user to their session. It's more or less a way to force somebody to use database sessions. I'm not simply satisfied that having a session is good enough. I want the session tied to a specific user.
Reply


Messages In This Thread
Community Auth Issue - by jaystream - 08-27-2017, 03:40 AM
RE: Community Auth Issue - by skunkbad - 08-27-2017, 03:10 PM
RE: Community Auth Issue - by jaystream - 08-28-2017, 04:44 PM
RE: Community Auth Issue - by skunkbad - 08-28-2017, 11:36 PM
RE: Community Auth Issue - by jaystream - 08-30-2017, 08:36 AM
RE: Community Auth Issue - by skunkbad - 08-30-2017, 05:19 PM
RE: Community Auth Issue - by jaystream - 08-31-2017, 01:42 AM
RE: Community Auth Issue - by sasbass - 08-31-2017, 02:24 AM
RE: Community Auth Issue - by jaystream - 08-31-2017, 02:50 AM
RE: Community Auth Issue - by skunkbad - 08-31-2017, 11:02 AM
RE: Community Auth Issue - by jaystream - 08-31-2017, 05:21 PM
RE: Community Auth Issue - by dave friend - 09-05-2017, 02:26 PM
RE: Community Auth Issue - by jaystream - 09-05-2017, 05:43 PM
RE: Community Auth Issue - by bocahapi - 12-05-2017, 04:06 PM
RE: Community Auth Issue - by skunkbad - 12-05-2017, 06:12 PM
RE: Community Auth Issue - by bocahapi - 12-09-2017, 05:39 PM
RE: Community Auth Issue - by skunkbad - 12-09-2017, 09:27 PM



Theme © iAndrew 2016 - Forum software by © MyBB