Symfony 2.3.* authentication
-
26-12-2019 - |
Question
After testing clean install of Symfony
2.3 inside vagrant with Ubuntu 12.04.4
and 14.04
like this:
composer create-project symfony/framework-standard-edition login_not_working 2.3.*
update vendors:
composer install
edit app_dev.php like this, on first line after <?php
for permissions:
umask(0000); // This will let the permissions be 0777
go to:
http://vagrant.dev/app_dev.php/
i click nice green button with RUN THE DEMO
text and try to login with user/userpass
or admin/adminpass
. Symfony redirects me to:
http://vagrant.dev/app_dev.php/
and in the profiler i see very impressive message You are not authenticated.
and with the extremly impressive red button too :D
This is just for testing and in actual application happens the same thing but on different setup... there i am using SonataUserBundle
that extends FOSUserBundle
...but it behaves the same...
I cleared cookies over, at least, 3 different browsers, clean cache with console and manually,...yada yada...
It smells like something with my vagrant box setup with/or/and a little flavor of permissions or maybe even sessions or ... boy is this kinky or what?
EDIT:
So, i uploaded both apps (clean test and my actual app with SonataUserBundle
) to my VPS and both are workin' fine. Still, on few of my vagrant boxes authentication is not working?
And app/check.php
output:
$ php app/check.php
OK PHP version must be at least 5.3.3 (5.5.12-2+deb.sury.org~precise+1 installed)
OK PHP version must not be 5.3.16 as Symfony wont work properly with it
OK Vendor libraries must be installed
OK app/cache/ directory must be writable
OK app/logs/ directory must be writable
OK date.timezone setting must be set
OK Configured default timezone "Europe/Berlin" must be supported by your installation of PHP
OK json_encode() must be available
OK session_start() must be available
OK ctype_alpha() must be available
OK token_get_all() must be available
OK simplexml_import_dom() must be available
OK detect_unicode must be disabled in php.ini
OK xdebug.show_exception_trace must be disabled in php.ini
OK xdebug.scream must be disabled in php.ini
OK PCRE extension must be available
** Optional recommendations **
OK xdebug.max_nesting_level should be above 100 in php.ini
OK Requirements file should be up-to-date
OK You should use at least PHP 5.3.4 due to PHP bug #52083 in earlier versions
OK When using annotations you should have at least PHP 5.3.8 due to PHP bug #55156
OK You should not use PHP 5.4.0 due to the PHP bug #61453
OK When using the logout handler from the Symfony Security Component, you should have at least PHP 5.4.11 due to PHP bug #63379 (as a workaround, you can also set invalidate_session to false in the security logout handler configuration)
OK You should use PHP 5.3.18+ or PHP 5.4.8+ to always get nice error messages for fatal errors in the development environment due to PHP bug #61767/#60909
OK PCRE extension should be at least version 8.0 (8.12 installed)
OK PHP-XML module should be installed
OK mb_strlen() should be available
OK iconv() should be available
OK utf8_decode() should be available
OK posix_isatty() should be available
OK intl extension should be available
OK intl extension should be correctly configured
OK intl ICU version should be at least 4+
OK a PHP accelerator should be installed
OK short_open_tag should be disabled in php.ini
OK magic_quotes_gpc should be disabled in php.ini
OK register_globals should be disabled in php.ini
OK session.auto_start should be disabled in php.ini
OK PDO should be installed
OK PDO should have some drivers installed (currently available: mysql, sqlite)
Solution
So, anyway, to answer my own question (kind of) and for the audience...thank you i'm fine... ;)
I configured Symfony to store sessions in memcached and that seems to resolve the problem (kind of). I'll test this on another machine/vagrant to confirm this :D
This "(kinf of)" is whole another story, but i'll leave that for another time :D
EDIT
I tested this on 2 more vagrant boxes and storing sessions to memcached resolve it :)