Working with cookies

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!
kdim95
Advanced
Posts: 206
Joined: 26 Aug 2022, 12:17

Working with cookies

Post by kdim95 » 09 Nov 2022, 10:45

Laravel framework version: 9.38.0
Aimeos Laravel version: * 2022.07.2
PHP Version: 8.1.12
Environment: Linux

Hello,

I am going to use custom cookies and was wondering if you have a set standard for working with cookies in Aimeos.
Currently I have included the js-cookie library in my app.js and setting cookies from aimeos.js.

I am facing an issue where I can't access the cookies I've set.
The cookie names are visible, but their values are always null no matter what they are set to.
This is how I am attempting to access them from the body() of my custom component.
$cookies = $this->view()->request()->getCookieParams();

Accessing the cookies via the PHP variable $_COOKIE works and their values are available.

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

Re: Working with cookies

Post by aimeos » 10 Nov 2022, 06:43

This might be more a Laravel question. Aimeos is using the native Laravel request object here:
https://github.com/aimeos/ai-laravel/bl ... hp#L73-L92
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply