Is it possible to create and manage baskets programatically?
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!
-
- Posts: 28
- Joined: 17 Aug 2023, 00:16
Is it possible to create and manage baskets programatically?
Laravel: 11.0
Aimeos: 2024.04
PHP: 8.2
Environment: Linux
I have my frontend running on different server, therefore frontend and backend do not share the csrf token. When basket is creared and retrieved they use csrf tokens to track the session. Is it possible to use some other token instead of csrf token for baskets? If not, can baskets be manages using managers and how to track basket session when creating them through managers?
Aimeos: 2024.04
PHP: 8.2
Environment: Linux
I have my frontend running on different server, therefore frontend and backend do not share the csrf token. When basket is creared and retrieved they use csrf tokens to track the session. Is it possible to use some other token instead of csrf token for baskets? If not, can baskets be manages using managers and how to track basket session when creating them through managers?
Re: Is it possible to create and manage baskets programatically?
By frontend, you are referring to a Javascript PWA and by backend to the Aimeos JSON:API?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,

-
- Posts: 28
- Joined: 17 Aug 2023, 00:16
Re: Is it possible to create and manage baskets programatically?
Yes, but the frontend and backend are running on different domains, therefore they cannot share csrf token.
I am serving data through JSON API but aimeos use csrf token to manage baskets. Is there a way to save and get baskets programatically other than JSON API?
Is there any other way to manage baskets other than JSON API?
I am serving data through JSON API but aimeos use csrf token to manage baskets. Is there a way to save and get baskets programatically other than JSON API?
Is there any other way to manage baskets other than JSON API?
Re: Is it possible to create and manage baskets programatically?
Running Aimeos JSON:API and e.g. a NodeJS server for a PWA on different (sub-)domains isn't recommended because this causes the browser to send a CORS request prior to every request to the API domain. That leads to two requests for every query and lowers performance drastically.
Nevertheless, there's no reason why you can't use the Laravel CSRF token in such a setup to manage the basket.
Nevertheless, there's no reason why you can't use the Laravel CSRF token in such a setup to manage the basket.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,

-
- Posts: 28
- Joined: 17 Aug 2023, 00:16
Re: Is it possible to create and manage baskets programatically?
What if I remove web middleware from jsonapi endpoint. This removes the need for sending cors request before every API request to backend. However, this leads to another problem, the /basket endpoint requires csrf token to track the basket details over the current session.
So, is there a way to manage basket using some token except csrf which I can send from Nodejs SPA from other domain? I have removed web middleware from jsonapi endpint to suit my needs.
So, is there a way to manage basket using some token except csrf which I can send from Nodejs SPA from other domain? I have removed web middleware from jsonapi endpint to suit my needs.
Re: Is it possible to create and manage baskets programatically?
Removing the "web" middleware group also removes all session handling.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,

-
- Posts: 28
- Joined: 17 Aug 2023, 00:16
Re: Is it possible to create and manage baskets programatically?
ok.. Thanks for response.