I am writing a web app using Symfony 1.3. I have a problem with my session variables getting lost after I call an action via jQuery's $.ajax()
call. Things happen in this order:
An action sets the session variable like this:
$this->getUser()->setAttribute('uploaded-files', $uploadedFiles);
Then when the action calls the view component, the resulting HTML page contains the following call:
$.ajax({ type: "POST", url: '<?php echo url_for("content/merge"); ?>', cache: false, success: mergingCompleteCallback });
I click on the button that triggers the above ajax call. The call executes the corresponding action method, but when I print out the content of the 'uploaded-files' session variable, it's empty.
I also checked to see if the session id stays the same between the call to the page that sets the variable and the page that reads the variable (the ajax call) and the session id hasn't changed. I was searching for hours online and I wasn't able to find a solution.