When a guest user puts items into a cart, they are stored in a session like session('cart', 'item1')
. However once user has logged in, this session gets destroyed for some reason, and I can no longer access it. Why does this session is removed and how do I keep it after user log in?
I tried to dd() the session even before the validation and login attempt takes place, but it still is removed.
public function postLogin(Request $request) {
dd(session('cart'));
// validate
// attempt to log in
}
It seems that it gets removed after "post". Is it a normal behavior in Laravel 5 or I'm doing something wrong?