I have saved my session in database, Now I want to get the shopping cart session of special user by user_id after scanning a qrcode and set that shopping cart session for Auth::user().
as you know, the session table in databse have these fields:
id, user_id, ip_address, user_agent, payload, last_activity
how to access the $cart = session()->get('cart'); by user_id ?
You should change the session_driver in config\session.php from the file to a database like:
and created the sessions table
and also change your .env file
SESSION_DRIVER=databaseAfter that DB session will work and you can check in our DB and you can manage it accordingly.