Laravel session is changing
					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!
	Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
- DamanMokha
 - Posts: 13
 - Joined: 29 Mar 2023, 03:00
 
Laravel session is changing
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?
			
			
			
									
									
						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?
Re: Laravel session is changing
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
			
			
			
									
									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,
 give us a star
						If you like Aimeos,