jenssegers / laravel-mongodb-session

A MongoDB session driver for Laravel
77 stars 27 forks source link

Doesn't work when mongo is not default. #3

Closed rtorcato closed 10 years ago

rtorcato commented 10 years ago

Is there a way to use mongo sessions when the default is mysql?

rtorcato commented 10 years ago

actually set mongodb to default and it still doesn't work.

jenssegers commented 10 years ago

Are you using the correct connection?

rtorcato commented 10 years ago

my connection to mongodb works. I have it pulling up some records from my mongodb.

when i do: Session::put('key', 'test'); It doesn't write anything to a session collection.

jenssegers commented 10 years ago

But did you select the correct connection in the session config?

rtorcato commented 10 years ago

yes 'driver' => 'mongodb', and 'connection' => 'mongodb' is set in session.php

jenssegers commented 10 years ago

I'm not having any issues with the mongodb session here. It creates a 'sessions' collection containing the session payloads.

rtorcato commented 10 years ago

hmm something wrong with what I'm doing. I placed a simple echo statement on createMongoDBDriver function and nothing.

jenssegers commented 10 years ago

Did you register the service provider?

rtorcato commented 10 years ago

yes i have both of these registered. The first one i know for sure is working because i have no problems getting records from mongo

    'Jenssegers\Mongodb\MongodbServiceProvider',
    'Jenssegers\Mongodb\Session\SessionServiceProvider',
rtorcato commented 10 years ago

looks like something wrong with my laravel installation. Regular database sessions are being stored. You can close this issue.