Crinsane / LaravelShoppingcart

A simple shopping cart implementation for Laravel
MIT License
3.67k stars 1.73k forks source link

Sessions #65

Closed edwinricaurte closed 9 years ago

edwinricaurte commented 9 years ago

Hello, I'm not sure if is an issue or not, but I'm using ollieread/multiauth, and if I add some products to the Cart, I logout and sign in with other user, the cart show the same cart from the other account.

Any idea? Thanks Edwin Ricaurte

Crinsane commented 9 years ago

I'm not familiar with that package. What does it do?

edwinricaurte commented 9 years ago

Thanks for your response.

is a package that allow Laravel to use 2 or more database tables (to storage the users). Multi Auth model.

But this package does not modify anything from the original Auth system.

How is saving the cart items your package? maybe is a larval session configuration (currently the model is file).

Can you please help me?

Thanks

Edwin Ricaurte

On Dec 30, 2014, at 3:19 AM, Rob Gloudemans notifications@github.com wrote:

I'm not familiar with that package. What does it do?

— Reply to this email directly or view it on GitHub https://github.com/Crinsane/LaravelShoppingcart/issues/65#issuecomment-68338253.

Crinsane commented 9 years ago

Well, how the session is stored, depends on your configuration. This package does nothing special concerning sessions and just uses the default session driver set in your config file.

If the other package you use, saves the user session in another way, separate from the 'default' laravel session, logging out doesn't destroy the cart.

I don't even know for sure of logging out destroys the entire session, or just removes the user data from it.

If you want the cart destroyed when one logs out, I think the best solution is to call Cart::destroy() manually, either in your controller or something? Or hook into some kind of 'logout' event.

edwinricaurte commented 9 years ago

Perfect,

Thanks again for your help. I’m going to add that function (destroy) to the logout function.

Edwin Ricaurte

On Dec 30, 2014, at 3:32 AM, Rob Gloudemans notifications@github.com wrote:

Well, how the session is stored, depends on your configuration. This package does nothing special concerning sessions and just uses the default session driver set in your config file.

If the other package you use, saves the user session in another way, separate from the 'default' laravel session, logging out doesn't destroy the cart.

I don't even know for sure of logging out destroys the entire session, or just removes the user data from it.

If you want the cart destroyed when one logs out, I think the best solution is to call Cart::destroy() manually, either in your controller or something? Or hook into some kind of 'logout' event.

— Reply to this email directly or view it on GitHub https://github.com/Crinsane/LaravelShoppingcart/issues/65#issuecomment-68338832.