title: Cookies not working in Laravel?
body: <p>When a new user visits my site I want to redirect them to /welcome but only once, I thought to do this I could use cookies and set a cookie forever once they had visited the welcome page and then checking if the cookie existed before sending them to /welcome.</p>
  
  <p>Here I have a base controller</p>
  
  <pre><code>class BaseController extends Controller
  {
      public function __construct(Request $request) 
      {
          $this-&gt;checkWelcome($request);
      }
  
      private function checkWelcome(Request $request) {
          $currentRoute = Route::currentRouteName();
  
          if ($currentRoute != 'frontend.guest.welcome' &amp;&amp; Cookie::get('visited_welcome') != '1') {
              header('location: ' . route('frontend.guest.welcome'));
              exit();
          }
      }
  }
  </code></pre>
  
  <p>When sending to <code>frontend.guest.welcome</code> it has a route to WelcomeController</p>
  
  <pre><code>Route::get('/welcome', ['uses' =&gt; 'WelcomeController@getView', 'as' =&gt; 'frontend.guest.welcome']);
  </code></pre>
  
  <p>Here is WelcomeController</p>
  
  <pre><code>class WelcomeController extends BaseController
  {
      public function getView()
      {
          Cookie::forever('visited_welcome', '1');
  
          return view('frontend.guest.welcome');
      }
  }
  </code></pre>
  
  <p>The issue is, its constantly sending to /welcome, not once but always.</p>