Created
March 18, 2012 08:48
-
-
Save brtriver/2070033 to your computer and use it in GitHub Desktop.
silex with cookie
This file contains hidden or 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__ .'/silex.phar'; | |
use Symfony\Component\HttpFoundation\Response; | |
use Symfony\Component\HttpFoundation\Cookie; | |
$app = new Silex\Application(); | |
$app['debug'] = true; | |
$app->get('/', function() { | |
$response = new Response('hello'); | |
$cookie = new Cookie('name', 'value'); | |
$response->headers->setCookie($cookie); | |
return $response; | |
}); | |
$app->run(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment