]> _ Git - cubist_cms-back.git/commitdiff
wip #3316 @0.25
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 8 Jan 2020 19:10:31 +0000 (20:10 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 8 Jan 2020 19:10:31 +0000 (20:10 +0100)
src/CookieServiceProvider.php
src/app/Middleware/StartSession.php [deleted file]

index 2c6c1add44951493161599eb43655d7ea6c9f51e..f35d55405e6fc820920d8ee146585c568f494f69 100644 (file)
@@ -13,15 +13,23 @@ class CookieServiceProvider extends Base
             $config = $app->make('config')->get('session');
 
             $domains = explode(',', $config['domain']);
+
             if (count($domains) === 1) {
                 $domain = $domains[0];
             } else {
                 foreach ($domains as $domain) {
                     if (stripos($_SERVER['HTTP_HOST'], $domain) !== false) {
+                        $found = $domain;
                         break;
                     }
                 }
+                if (!isset($found)) {
+                    $domain = $_SERVER['HTTP_HOST'];
+                } else {
+                    $domain = $found;
+                }
             }
+            config(['session.domain' => $domain]);
 
             return (new CookieJar)->setDefaultPathAndDomain(
                 $config['path'], $domain, $config['secure'], $config['same_site'] ?? null
diff --git a/src/app/Middleware/StartSession.php b/src/app/Middleware/StartSession.php
deleted file mode 100644 (file)
index c60d888..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-<?php
-
-
-namespace Cubist\Backpack\app\Middleware;
-
-use Illuminate\Session\Middleware\StartSession as Base;
-
-class StartSession extends Base
-{
-
-}