Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This project is not covered by Drupal’s security advisory policy.
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()
Project information
- Minimally maintained
Maintainers monitor issues, but fast responses are not guaranteed. - Maintenance fixes only
Considered feature-complete by its maintainers. - Module categories: Developer Tools
- Ecosystem: Custom Module Tools
- 54 sites report using this module
- Created by erlendoos on , updated
- This project is not covered by the security advisory policy.
Use at your own risk! It may have publicly disclosed vulnerabilities.