Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Session Entity

Security covered Under active development 14 sites

This module allows you to create entities that are stored directly in a user's session. These session entities behave like normal content entities, meaning you can add fields to them, and they can be used to store information for both anonymous and authenticated users. This is useful for temporary data like user preferences or selections that should disappear when the user's session ends.

Session Entity provides entities which are stored in the user's session. Each
user has one entity, which they may edit (provided they have the permission).
This is a normal content entity, which may have fields added to it.

This allows anonymous users to create content which will automatically expire
when their session expires.

The module uses a custom entity storage controller to store entity data in
the private tempstore.

Example uses include allowing site visitors to select preferences or set details
about themselves such as a location.

To retrieve the session entity for the current user:

  $session_entity = \Drupal::service('session_entity.current')->getCurrentUserSessionEntity();
Drupal 8–10 · not 11

Ask your assistant about Session Entity

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.

Activity

Tracked releases
3
Tracked since
Jan 2024
Latest release
2 years ago
Releases (12 mo)
0
Maintenance
Dormant

Release Timeline

Releases

Version Type Core PHP Release date
2.0.x-dev Dev 8–11 Jan 30, 2024
2.0.1 Stable 8–10 Jan 23, 2024
2.0.0 Stable 8–10 Jan 12, 2024