PHP Classes

File: vendor/symfony/http-foundation/Tests/Session/Storage/Handler/Fixtures/storage.php

Recommend this page to a friend!
  Classes of Stanley Aloh   Tic Tac Toe Multiplayer   vendor/symfony/http-foundation/Tests/Session/Storage/Handler/Fixtures/storage.php   Download  
File: vendor/symfony/http-foundation/Tests/Session/Storage/Handler/Fixtures/storage.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Tic Tac Toe Multiplayer
Manage the interactions ofTic-Tac-Toe game players
Author: By
Last change:
Date: 9 days ago
Size: 676 bytes
 

Contents

Class file image Download
<?php

require __DIR__.'/common.inc';

use
Symfony\Component\HttpFoundation\Session\Flash\FlashBag;
use
Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage;

$storage = new NativeSessionStorage();
$storage->setSaveHandler(new TestSessionHandler());
$flash = new FlashBag();
$storage->registerBag($flash);
$storage->start();

$flash->add('foo', 'bar');

print_r($flash->get('foo'));
echo empty(
$_SESSION) ? '$_SESSION is empty' : '$_SESSION is not empty';
echo
"\n";

$storage->save();

echo empty(
$_SESSION) ? '$_SESSION is empty' : '$_SESSION is not empty';

ob_start(function ($buffer) { return str_replace(session_id(), 'random_session_id', $buffer); });