Permalink
Browse files

include Sonic Util in session extension

  • Loading branch information...
1 parent f0d704d commit 3d3d1206027a16474012ed876cadcfaf06e4969d @ccampbell committed Mar 11, 2011
Showing with 4 additions and 0 deletions.
  1. +4 −0 session/Session.php
View
@@ -1,5 +1,6 @@
<?php
namespace Sonic;
+use Sonic\App;
/**
* Session
@@ -123,6 +124,7 @@ public function setName($name)
public function setLifetime($lifetime)
{
$this->_lifetime = $lifetime;
+ App::getInstance()->includeFile('Sonic/Util.php');
return ini_set('session.gc_maxlifetime', Util::toSeconds($lifetime));
}
@@ -140,6 +142,7 @@ public function setLifetime($lifetime)
public function setCookieParams($lifetime = 0, $path = '/', $domain = '', $secure = false, $http_only = false)
{
$this->_lifetime = $lifetime;
+ App::getInstance()->includeFile('Sonic/Util.php');
$lifetime = Util::toSeconds($lifetime);
session_set_cookie_params($lifetime, $path, $domain, $secure, $http_only);
}
@@ -216,6 +219,7 @@ public function getId()
*/
protected function _setCookie($expiration)
{
+ App::getInstance()->includeFile('Sonic/Util.php');
$expiration = Util::toSeconds($expiration);
$params = session_get_cookie_params();
setcookie(

0 comments on commit 3d3d120

Please sign in to comment.