Skip to content

Instantly share code, notes, and snippets.

@brtriver
Created March 18, 2012 08:48
Show Gist options
  • Save brtriver/2070033 to your computer and use it in GitHub Desktop.
Save brtriver/2070033 to your computer and use it in GitHub Desktop.
silex with cookie
<?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