I have registered a MySQL-based UserProvider with my $app, as described in: http://www.bubblecode.net/en/2012/08/28/mysql-authentication-in-silex-the-php-micro-framework/
I have set my passwords to use sha1 successfully, so far, so good.
$app['security.encoder.digest'] = $app->share(function ($app) {
// use the sha1 algorithm
// don't base64 encode the password
// use only 1 iteration
return new MessageDigestPasswordEncoder('sha1', false, 1);
});
My problem is: users are authenticated or rejected as appropriate, with redirect to the default route in case of successful authentication, but the login is not preserved. Eq. if I then return to my /login form, and print the user token, I get:
AnonymousToken(user="anon.", authenticated=true, roles="")
No matter what I seem to do. Any help would be appreciated please: I tried making sure that my sessions are started in the "before" controller: they are.
$app['session']->start();
I should mention that I am running HHVM instead of "vanilla PHP". It should roughly correspond to PHP 5.5 and everything else seems to work.
In advance thank you for your help.
EDIT: it appears to be a problem with HHVM and the version of Silex in use, which I am reporting now to the Silex team. The same code works just fine with php5-fpm.