@@ -130,16 +130,12 @@ public function __construct($app = null)
130130 public function getHttpDriver ()
131131 {
132132 if ($ this ->httpDriver === null ) {
133- if ($ this ->app ->bound ('cookie ' )) {
134- $ this ->httpDriver = $ this ->app ->make (SessionHttpDriver::class);
135- } else {
136- $ this ->httpDriver = $ this ->app ->make (SymfonyHttpDriver::class);
137- }
133+ $ this ->httpDriver = $ this ->app ->make (SymfonyHttpDriver::class);
138134 }
139135
140136 return $ this ->httpDriver ;
141137 }
142-
138+
143139 /**
144140 * Enable the Debugbar and boot, if not already booted.
145141 */
@@ -740,6 +736,12 @@ public function modifyResponse(Request $request, Response $response)
740736 // Prevent duplicate modification
741737 $ this ->responseIsModified = true ;
742738
739+ // Set the Response if required
740+ $ httpDriver = $ this ->getHttpDriver ();
741+ if ($ httpDriver instanceof SymfonyHttpDriver) {
742+ $ httpDriver ->setResponse ($ response );
743+ }
744+
743745 // Show the Http Response Exception in the Debugbar, when available
744746 if (isset ($ response ->exception )) {
745747 $ this ->addThrowable ($ response ->exception );
@@ -757,11 +759,11 @@ public function modifyResponse(Request $request, Response $response)
757759
758760 $ sessionHiddens = $ app ['config ' ]->get ('debugbar.options.session.hiddens ' , []);
759761 if ($ app ->bound (SessionManager::class)) {
762+ /** @var \Illuminate\Session\SessionManager $sessionManager */
763+ $ sessionManager = $ app ->make (SessionManager::class);
760764
761765 if ($ this ->shouldCollect ('session ' ) && ! $ this ->hasCollector ('session ' )) {
762766 try {
763- /** @var \Illuminate\Session\SessionManager $sessionManager */
764- $ sessionManager = $ app ->make (SessionManager::class);
765767 $ this ->addCollector (new SessionCollector ($ sessionManager , $ sessionHiddens ));
766768 } catch (Exception $ e ) {
767769 $ this ->addCollectorException ('Cannot add SessionCollector ' , $ e );
0 commit comments