Skip to content

Commit

Permalink
Add Session and Cookie Trait
Browse files Browse the repository at this point in the history
  • Loading branch information
mehrshaddarzi committed Mar 26, 2023
1 parent aadc205 commit e4b92fb
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 25 deletions.
2 changes: 1 addition & 1 deletion src/Http/Cookie.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function set($name, $value, $expire = 3600, $sanitize = true)
return setcookie($name, ($sanitize === true ? $this->sanitizeCookieValue($value) : $value), (time() + (int)$expire), COOKIEPATH, COOKIE_DOMAIN);
}

public function save($value, $expire = '', $sanitize = true, $name = null)
public function save($value, $expire = 3600, $sanitize = true, $name = null)
{
return $this->set((is_null($name) ? $this->name : $name), $value, $expire, $sanitize);
}
Expand Down
12 changes: 0 additions & 12 deletions src/Traits/Cookie.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,6 @@
trait Cookie
{

/**
* PHP Cookie
*
* @var \WPTrait\Http\Cookie
*/
public $cookie;

public function __construct()
{
$this->cookie = new \WPTrait\Http\Cookie();
}

public function cookie($name): \WPTrait\Http\Cookie
{
return new \WPTrait\Http\Cookie($name);
Expand Down
12 changes: 0 additions & 12 deletions src/Traits/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,6 @@
trait Session
{

/**
* PHP Session
*
* @var \WPTrait\Http\Session
*/
public $session;

public function __construct()
{
$this->session = new \WPTrait\Http\Session();
}

public function session($name): \WPTrait\Http\Session
{
return new \WPTrait\Http\Session($name);
Expand Down

0 comments on commit e4b92fb

Please sign in to comment.