Jsonapi fetch basket always empty
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Jsonapi fetch basket always empty
Jsonapi fetch basket always empty
Aimeos version 2022.10.3 Laravel version 9.31.0, PHP version 8.0.23, Ubuntu 20.04.5 LTS
In JSON API basket save give always empty basket response.
Here example form postman.
First is add product to basket - it works.
After that fetch - and it's empty
At .env - SESSION_DRIVER=file
Aimeos version 2022.10.3 Laravel version 9.31.0, PHP version 8.0.23, Ubuntu 20.04.5 LTS
In JSON API basket save give always empty basket response.
Here example form postman.
First is add product to basket - it works.
After that fetch - and it's empty
At .env - SESSION_DRIVER=file
- Attachments
-
- basket_created.jpg (113.65 KiB) Viewed 2389 times
-
- always_empty.jpg (107.92 KiB) Viewed 2389 times
Re: Jsonapi fetch basket always empty
Do you pass the Laravel session ID (e.g. "aimeos_session") to the API too?
Otherwise, the server doesn't know that your requests belong together.
Otherwise, the server doesn't know that your requests belong together.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: Jsonapi fetch basket always empty
Looks like no. I used csrf token. But as I show at fetch basket sreen - order.base.customerid is present and it's real user login id that I logged in. In this case don't know why basket empty. Could be please some details about ID (aimeos_session) value. Where I can check that it turn on (and see value) and where I should put it at Api basket fetch call
Re: Jsonapi fetch basket always empty
The ID of a registered user is irrelevant, all basket data is stored in the Laravel session so guest checkouts are also possible. The Laravel session token is a cookie sent by Laravel to the client over HTTP. You can see it in the network section of the browser console.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: Jsonapi fetch basket always empty
I checked also Web version: add product to Basket - and there is present laravel_session for logged in user, but basket always empty too. Nothing add there. If I go to checkout page after add product nothing change. Stock for product is present (37).
Maybe there some value at config or anything else to check?
Maybe there some value at config or anything else to check?
- Attachments
-
- stock_level.jpg (59.37 KiB) Viewed 2307 times
-
- 1_empty_basket.jpg (144.8 KiB) Viewed 2307 times
Re: Jsonapi fetch basket always empty
There seems to be something else wrong. Some things to check:
- Is the laravel_session cookie always the same?
- Is the basket stored in the mshop_order_basket table?
- Does it also occur if you disable rate limiting (which seems to be activated by you according to your screenshot)?
- Is the laravel_session cookie always the same?
- Is the basket stored in the mshop_order_basket table?
- Does it also occur if you disable rate limiting (which seems to be activated by you according to your screenshot)?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: Jsonapi fetch basket always empty
If you install aimeos/ai-client-html:2022.10.x-dev, there's a fix for displaying error messages in overlays. They had been skipped before. Maybe that helps debugging:
Code: Select all
composer aimeos/ai-client-html:2022.10.x-dev
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: Jsonapi fetch basket always empty
Thank you for all explanation.Everything is worked - added \Illuminate\Session\Middleware\StartSession at Api routes at Kernel.