BrowserCookieTrait.php in Zircon Profile 8
File
vendor/jcalderonzumba/gastonjs/src/Browser/BrowserCookieTrait.php
View source
<?php
namespace Zumba\GastonJS\Browser;
use Zumba\GastonJS\Cookie;
trait BrowserCookieTrait {
public function cookies() {
$cookies = $this
->command('cookies');
$objCookies = array();
foreach ($cookies as $cookie) {
$objCookies[$cookie["name"]] = new Cookie($cookie);
}
return $objCookies;
}
public function setCookie($cookie) {
if (isset($cookie["expires"])) {
$cookie["expires"] = intval($cookie["expires"]) * 1000;
}
$cookie['value'] = urlencode($cookie['value']);
return $this
->command('set_cookie', $cookie);
}
public function removeCookie($cookieName) {
return $this
->command('remove_cookie', $cookieName);
}
public function clearCookies() {
return $this
->command('clear_cookies');
}
public function cookiesEnabled($enabled = true) {
return $this
->command('cookies_enabled', $enabled);
}
}