Aimeos Headless - Session Handler

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!
kappa_dev
Posts: 2
Joined: 20 Dec 2021, 13:09

Aimeos Headless - Session Handler

Post by kappa_dev » 21 Dec 2021, 12:35

Hi,
As mentioned by Norbert in his email, we need to switch the "laravel aimeos adapter" to adapt the aimeos works with JWT, so here is my questions:

- from where and how we should change this adapter ?

- any suggestions for "laravel aimeos adapter" alternative that works with JWT?

OS: Mac
Aimeos Ver: dev-master
Laravel: v8.75
PHP: v8.0.12
DB: MySQL

Tnx.
Kappa Dev.

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

Re: Aimeos Headless - Session Handler

Post by aimeos » 22 Dec 2021, 12:18

We need to store the session data in a database table, similar to the madmin_cache table and must consist of the JWT token, the content and a mtime field so we can remove old entries again:

madmin_session
- id VARCHAR (255 chars)
- content TEXT (2GB)
- mtime DATETIME

The content should be JSON encoded or PHP serialized array (depending on performance) of key/value pairs.

The JWT session class must implement this interface:

https://github.com/aimeos/aimeos-core/b ... /Iface.php

Then, we can overwrite the context class from the aimeos-laravel package in the aimeos-headless code and add the JWT session implementation there:

https://github.com/aimeos/aimeos-larave ... #L252-L257
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply