Laravel 8 config “SESSION_STORE” and ”SESSION_DRIVER”

Essentially, it allows you to configure a separate CACHE_STORE from your SESSION_STORE.

Imagine you have APIv1 where you are caching queries using encrypted cache keys in Redis along with caching your User Sessions also in Redis.

Let’s say you want to rollout APIv2 and want to clear all of your cached queries but not Log all of your users out.

If you’re CACHE_STORE and SESSION_STORE are the same instance of a Redis Store you can not run php artisan cache:clearwithout clearing both stores. And hunting down all of the encrypted cache keys you want to clear would be very difficult and time consuming.

However, if you setup your User Sessions on a separate Redis Store you can run it with confidence.

This is an example of why someone would use CACHE_STORE or SESSION_STORE, each of which can be pointed to separate Redis Database/Instances that you have configured in config/database.php.