Laravel session is changing

Help for integrating the Laravel package
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
User avatar
DamanMokha
Posts: 13
Joined: 29 Mar 2023, 03:00

Laravel session is changing

Post by DamanMokha » 30 Mar 2023, 08:19

Hi,

My Laravel session ID keeps changing with every request, which is causing my basket to be empty consistently. I am using Laravel 9.

Since it is necessary to send the session along with the basket request in order to obtain the same value for the basket, I checked the aimeos_session values and noticed that they are different each time. Can you please suggest a solution to this issue?

User avatar
aimeos
Administrator
Posts: 7866
Joined: 01 Jan 1970, 00:00

Re: Laravel session is changing

Post by aimeos » 31 Mar 2023, 07:02

Most likely, you are not sending the cookies back to the server for each request. If you are using a different domain/port for the frontend app then the backend is running, you have to tell the browser to include the cookies in the request:
https://github.com/github/fetch#sending-cookies

Furthermore, in that case CORS will be a problem and you should add "/jsonapi/*" here:
https://github.com/aimeos/aimeos/blob/m ... rs.php#L18

And active credentials support here:
https://github.com/aimeos/aimeos/blob/m ... rs.php#L32
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply