I use BlueImp file uploader server side with symfony 2.1 as external must-be-lightweight php UploadHandler.php script
I want to get logged user id to use its own directory for uploading
For security reasons it must be done by session, not POST.
in external file when I try session_start(), $_SESSION still empty.
I know how to do it with 1.4:
Symfony sessions outside app?
but I have no idea for 2.1
Maybe I am wrong and there is better way to achieve user id in external script.
If you have firewall called
mainin your security.yml config, you should have access to security token (serialized) under$_SESSION['_sf2_attributes']['_security_main']notice that second key have pattern: `_security_filewallName’In your case punkave/symfony2-file-upload-bundle can be interesting too.