Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
S
Silex
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
common
Silex
Commits
d27a20b2
Commit
d27a20b2
authored
Jun 30, 2012
by
Fabien Potencier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed unneeded start() calls for the session
parent
b6658610
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
5 deletions
+1
-5
doc/providers/security.rst
doc/providers/security.rst
+1
-3
doc/providers/session.rst
doc/providers/session.rst
+0
-2
No files found.
doc/providers/security.rst
View file @
d27a20b2
...
...
@@ -173,11 +173,9 @@ Always keep in mind the following two golden rules:
* The ``check_path`` path must always be defined **inside** the secured area.
For the login form to work, create a controller
where you start the session
::
For the login form to work, create a controller
like the following
::
$app->get('/login', function(Request $request) use ($app) {
$app['session']->start();
return $app['twig']->render('login.html', array(
'error' => $app['security.last_error']($request),
'last_username' => $app['session']->get('_security.last_username'),
...
...
doc/providers/session.rst
View file @
d27a20b2
...
...
@@ -66,7 +66,6 @@ authenticates a user and creates a session for him::
$password = $app['request']->server->get('PHP_AUTH_PW');
if ('igor' === $username && 'password' === $password) {
$app['session']->start();
$app['session']->set('user', array('username' => $username));
return $app->redirect('/account');
}
...
...
@@ -78,7 +77,6 @@ authenticates a user and creates a session for him::
});
$app->get('/account', function () use ($app) {
$app['session']->start();
if (null === $user = $app['session']->get('user')) {
return $app->redirect('/login');
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment