Auth using NoSQL with M2 (MongoDB) don'...

  • Nguyen Tuan Anh

    Nguyen Tuan Anh - 2012-02-07

    Hi everybody,

    Does anyone try to using auth with mongoDB using M2 yet?

    I'm trying but get error, so please check for me:

    This is my code

            $auth = Auth::nosql('admin','123456');
            if ($auth) {
                //set the session so user stays logged in
                echo 'logged in';
            } else {
                echo 'can\'t login';    

    But this show error:

    Fatal error: Call to a member function listCollections() on a non-object

    0 /Users/xxxxx/Dev/www/bookmator/lib/m2.php:92

    Please help,

    Best regards,

  • Bong Cosca

    Bong Cosca - 2012-02-07

    Is the mongodb extension enabled in php.ini?

  • Nguyen Tuan Anh

    Nguyen Tuan Anh - 2012-02-09

    Hi bcosca,

    I've enabled in php.ini, and successful in using F3 to Crud with MongoDB, i
    just have problem with Auth::nosql,
    Could you please show me some working sample code usingAuth::nosql?

    Best regards,


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks