diff --git a/src/App.php b/src/App.php
index f474726..10efa9d 100644
--- a/src/App.php
+++ b/src/App.php
@@ -22,8 +22,8 @@ public function __construct()
     {
         $this->loadEnv();
         $this->configureEnvironment();
-        $this->setApp();
         $this->registerComponents();
+        $this->setApp();
         $this->bootServices();
     }
 
@@ -206,7 +206,7 @@ private function generateTokens(): string
     public function setCsrfCookie(string $csrfToken): void
     {
         $expiration = config('session.expiration');
-        setcookie('csrfToken', $csrfToken, time() + 60 * $expiration);
+        setcookie('csrfToken', $csrfToken, (int) time() + 60 * $expiration);
     }
 
     /**