Simple Share Session neiderruiz/flarum-simple-share-session

Simple Share Session for Flarum

install package

composer install neiderruiz/flarum-simple-share-session

enable extension on Flarum

the extension will check the session id from the cookie and send a request to the API to verify the session.

$cookies = $request->getCookieParams();
$sessionId = $cookies['sessionid'] ?? null;

add endpoint to check session on Falrum extension settings

https://domain.com/api/verify-session

Your endpoint will receive the parameter through the url for example:

https://domain.com/api/verify-session?sessionid=123456789

expected response

{
    "user": {
        "id": 1,
        "username": "admin",
        "email": "[email protected]",
        "name": "Admin",
    }
}

developent config

npm run build

refresh changes

composer update neiderruiz/flarum-simple-share-session *@dev
php flarum cache:clear                                
php flarum assets:publish

Versions

  • Version 0.0.1.

    Likely works with Flarum v1.8.9.

    Unlikely to work with Flarum v2.0.0-beta.2.

  • Extension created.