• Categories
    • PHP
    • phpMyAdmin
    • PHPMailer
    • FFMpeg
    • PHPEXcel
    • PHPDoc
    • PHPUnit
    • CakePHP
    • CakePHP 2.0
    • Cake PHP 2.1
    • CakePHP Model
    • Facebook PHP SDK
    • composer-php
    • PHP 7
    • PHP GD
    All Categories
  • About

how can I set a session variable in Drupal 8 and get it in a php script?

phpsessiondrupalsession-variables


PHP Snippet 1:

$tempstore = \Drupal::service('tempstore.private')->get('your_module_name');
$tempstore->set('value', 'hi');

PHP Snippet 2:

$tempstore = \Drupal::service('tempstore.private')->get('your_module_name');
$some_data = $tempstore->get('value');

Related Snippets

woocommerce get_order_report_data to show order_item_id

if statement inside concatenation

Any AWS EB Laravel route getting 404 Not Found nginx/1.16.1

How to add automatically collapse/expand in content wordpress (single.php)?

PHP Fatal error: Class not found - PHPUnit

HTML + PHP + PHPMAILER

PHP cURL (SSL certificate problem: self signed certificate in certificate chain)

How to get Laravel's CSRF Token from Another Website?

Best way to scrolldown onpageload

using random function but it's displaying duplicates

PHP header location absolute URL

Xdebug in Laravel is not working with VSCode

Why do I have invalid argument supply for foreach in Laravel for json response? [duplicate]

PHPMetrics option --excluded-dirs="myfolder" : myfolder dir is not excluded within docker

Remove product downloads section in woocommerce email notifications

About Contact Privacy policy Terms and conditions