Different redis databases for cache and sessions in Laravel 4.2

I am trying to move away from file cache and use redis instead. I can get it working using the same redis database for cache and sessions but this means I cannot clear the application cache without losing all sessions so I am wanting to run the two on different databases on the same server. My configs are as follows:


      'redis' => array(

          'cluster' => false,

              'default' => array('host' => 'redisserverip', 'port' => 6379, 'database' => 0),
              'session' => array('host' => 'redisserverip', 'port' => 6379, 'database' => 1),



      'driver' => 'redis',
      'connection' => null,


      'driver' => 'redis',          
      'connection' => 'session',

This is not working as both the application cache and sessions are being saved into the 1st database when it should be shared accross the 0th and 1st database. Is this a bug in Laravel or a problem with my config?


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s