Created
March 23, 2012 00:28
-
-
Save davedevelopment/2165807 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require __DIR__.'/vendor/.composer/autoload.php'; | |
$app = new Silex\Application(); | |
$app->register(new Silex\Provider\SessionServiceProvider()); | |
$app['debug'] = true; | |
$app->get('/', function() use($app) { | |
$string = 'Hello '.$app['session']->get('last_request_time'); | |
$app['session']->set('last_request_time', time()); | |
var_dump($app['session']); | |
return $string; | |
}); | |
$app->run(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
array(0) { | |
} | |
array(1) { | |
["dave"]=> | |
string(25) "dave0.01975100 1332462560" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object(Symfony\Component\HttpFoundation\Session\Session)#52 (3) { | |
["storage":protected]=> | |
object(Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage)#53 (4) { | |
["bags":protected]=> | |
array(2) { | |
["attributes"]=> | |
object(Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag)#56 (3) { | |
["name":"Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag":private]=> | |
string(10) "attributes" | |
["storageKey":"Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag":private]=> | |
string(15) "_sf2_attributes" | |
["attributes":protected]=> | |
&array(1) { | |
["last_request_time"]=> | |
int(1332462612) | |
} | |
} | |
["flashes"]=> | |
object(Symfony\Component\HttpFoundation\Session\Flash\FlashBag)#57 (3) { | |
["name":"Symfony\Component\HttpFoundation\Session\Flash\FlashBag":private]=> | |
string(7) "flashes" | |
["flashes":"Symfony\Component\HttpFoundation\Session\Flash\FlashBag":private]=> | |
&array(0) { | |
} | |
["storageKey":"Symfony\Component\HttpFoundation\Session\Flash\FlashBag":private]=> | |
string(12) "_sf2_flashes" | |
} | |
} | |
["started":protected]=> | |
bool(true) | |
["closed":protected]=> | |
bool(false) | |
["saveHandler":protected]=> | |
object(Symfony\Component\HttpFoundation\Session\Storage\Proxy\NativeProxy)#55 (3) { | |
["wrapper":protected]=> | |
bool(false) | |
["active":protected]=> | |
bool(false) | |
["saveHandlerName":protected]=> | |
string(5) "files" | |
} | |
} | |
["flashName":"Symfony\Component\HttpFoundation\Session\Session":private]=> | |
string(7) "flashes" | |
["attributeName":"Symfony\Component\HttpFoundation\Session\Session":private]=> | |
string(10) "attributes" | |
} | |
Hello |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
array(3) { | |
["dave"]=> | |
string(25) "dave0.01975100 1332462560" | |
["_sf2_attributes"]=> | |
array(1) { | |
["last_request_time"]=> | |
int(1332462612) | |
} | |
["_sf2_flashes"]=> | |
array(0) { | |
} | |
} | |
array(3) { | |
["dave"]=> | |
string(25) "dave0.11753100 1332462642" | |
["_sf2_attributes"]=> | |
array(1) { | |
["last_request_time"]=> | |
int(1332462612) | |
} | |
["_sf2_flashes"]=> | |
array(0) { | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
session_start(); | |
var_dump($_SESSION); | |
$_SESSION['dave'] = 'dave' . microtime(); | |
var_dump($_SESSION); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment