Hello i need help to decide what the best session driver i must use in my e-commerce website. Redis? Memcached? file driver? or other?
Sessions are used to store information about the user across the requests. Laravel provides various drivers like file, cookie, apc, array, Memcached, Redis, and database to handle session data. By default, file driver is used because it is lightweight. Session can be configured in the file stored at config/session.
User has to make a booking. If the user is not logged in I have to set a session with the $event->id. Then after he logs in should be redirected to booking form blade.
It depends on your setup
If you choose the file session driver
, your session data
will be saved in the app/storage/sessions folder on the server
.
If you choose the database
session driver, you can use the DB to keep sessions.
Otherwise, you can store the data (encrypted) in the user cookies.
Why use file driver:-
The advantage of using the file driver
could be that mySQL/SQL
server load whereas file
access should be faster.
Why use database driver:-
If your site isn't that big (couple hundreds unique a day). It also provides you with easy access to all the users logged in from a time period so you can track stuff.
Why use Redis / Memcached driver:-
Redis & Memcached
driver both provide high reading speed. so when you need to frequently access data, this is your best choice & also if your site is very big & the data read/write frequency is high.
So choose any of them according to your need.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With