Mejoras a administracion
This commit is contained in:
@ -11,8 +11,9 @@ class Login {
|
||||
protected $password;
|
||||
protected $filename;
|
||||
protected $manager;
|
||||
public function __construct(string $cookie_name, int $time_limit, string $encrypted_password, string $login_file, Filemanager $filemanager) {
|
||||
public function __construct(string $cookie_name, int $time_limit, string $base_url, string $encrypted_password, string $login_file, Filemanager $filemanager) {
|
||||
$this->cookie_name = $cookie_name;
|
||||
$this->base_url = $base_url;
|
||||
$this->time_limit = $time_limit;
|
||||
$this->password = $encrypted_password;
|
||||
$this->filename = $login_file;
|
||||
@ -31,7 +32,7 @@ class Login {
|
||||
public function saveCookie() {
|
||||
$now = Carbon::now();
|
||||
$exp = $now->addSeconds($this->time_limit);
|
||||
\setcookie($this->cookie_name, implode(':', [$this->selector, $this->token]), $exp->timestamp, '/');
|
||||
\setcookie($this->cookie_name, implode(':', [$this->selector, $this->token]), $exp->timestamp, $this->base_url);
|
||||
}
|
||||
public function removeCookie() {
|
||||
\setcookie($this->cookie_name, '', Carbon::now()->timestamp, '/');
|
||||
|
Reference in New Issue
Block a user