#4656: Session destroyed after non-CakePHP redirect ---------------------------------------------------------------------+------ Reporter: ZoeB | Owner: Type: Bug | Status: reopened Priority: Medium | Milestone: Component: Session | Version: RC1 Severity: Normal | Resolution: Keywords: session reset destroyed safari firefox redirect ZoeB | Php_version: PHP 5 Cake_version: 6311 | ---------------------------------------------------------------------+------ Comment (by mryellow):
http://au2.php.net/manual/en/function.session-write-close.php From the comments: [quote] Workaround if session_write_close() still doesn't write sessions fast enough: I found with one PHP login system that even session_write_close() was not setting the session variables before I transferred pages with a Location: header. So the user would log in, I would create the $_SESSION variables, call session_write_close() and then transfer to the secure page using header(Location:...). The secure page would check for the session vars, not find them, and force the user to log in again. After the second login the session would be found and they could continue. My workaround was to create the $_SESSION variables with 0 values before writing the initial login page. Then I updated the session vars with the login results and used the header() function to switch to the secure location. Once the session vars have already been created, updated values are assigned quickly. Problem solved. Just be sure the secure page checks both that the $_SESSION var exists AND that it's not 0. [/quote] -- Ticket URL: <https://trac.cakephp.org/ticket/4656#comment:10> CakePHP : The Rapid Development Framework for PHP <https://trac.cakephp.org/> Cake is a rapid development framework for PHP which uses commonly known design patterns like ActiveRecord, Association Data Mapping, Front Controller and MVC. Our primary goal is to provide a structured framework that enables PHP users at all levels to rapidly develop robust web applications, without any loss to flexibility. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "tickets cakephp" group. To post to this group, send email to tickets-cakephp@googlegroups.com To unsubscribe from this group, send email to tickets-cakephp+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/tickets-cakephp?hl=en -~----------~----~----~----~------~----~------~--~---