This module ensures that anonymous users have a reliable session available for features that depend on session data. It provides a service that can be called to initialize an anonymous session before it's used.
Add a consistent way to the website to ensure a session for anonymous users for reliable session related functionality.
Include the service in your application where the session is important, and call the 'apply' method before using the session
$anonymousSession = \Drupal::service('anonymoussession');
$anonymousSession->apply();
// Use session variables:
//$_SESSION[...]
Use cases include:
- PrivateTempStore
- Functionality that depends on Drupal::currentRequest()->getSession()
Ask your assistant about Anonymous session Toolkit
Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works
Depends on
Dependencies of the latest stable release
No dependencies recorded for this project.
Required by
Tracked projects that depend on this one
No tracked projects depend on this one yet.