Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-22414

Session is lost when redirecting from a legacy module

    XMLWordPrintable

    Details

      Description

      This only occurs when using Symfony stack, with legacy fallback.

      In a legacy module, when you set a session variable and then perform a redirection (e.g. using $Module->redirectTo( '/' )) to a page managed by Symfony stack, created session will be lost during the redirection process.

      Steps to reproduce

      1. Create a legacy module with the following code:
        <?php
        $Module = $Params['Module'];
        $Result = array();
        
        $http = eZHTTPTool::instance();
        $http->setSessionVariable( 'foo', time() );
        $Module = $Params['Module'];
        return $Module->redirectTo( "/my_custom_controller_uri" );
        
      2. Create a custom symfony controller with a /my_custom_controller_uri route, and ensure you dump foo session variable:
        var_dump( $this->getRequest()->getSession()->get( 'foo' ) );
        
      3. Access to your legacy module URL, you'll be redirected to your custom controller and foo session variable will be null

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              eduardo.fernandes-obsolete@ez.no Eduardo Fernandes (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              11 Start watching this issue

                Dates

                Due:
                Created:
                Updated:
                Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 3 days, 7 hours, 30 minutes
                  3d 7h 30m