How would I get a session value from a session variable stored in the Drupal way.

$tempstore = \Drupal::service('user.private_tempstore')->get('mymodule_name');
$tempstore->set('my_variable_name', $some_data);

It is equivalent to:

$_SESSION['mymodule_name']['my_variable_name'] = $somedata;

So there seems to be an extra layer of 'mymodule_name'. Is that even possible to use with this module, or should we just use _SESSION directly when setting values?

CommentFileSizeAuthor
#2 deeper_array-2911802-2.patch2.65 KBguptahemant

Comments

missdrupal created an issue. See original summary.

guptahemant’s picture

Status: Active » Needs review
StatusFileSize
new2.65 KB

Here is a patch attached to extend the functionality of this module to manage deeper level of sessions.
To specify multidimensional variables user has to specify Keys of SESSION variable seperated by ::, e.g. for $_SESSION["key1"]["key2"], the key would be "key1::key2".

Please review.

purushotam.rai’s picture

LGTM :)

purushotam.rai’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.