Skip to content

Instantly share code, notes, and snippets.

@phalcon

phalcon/session.php

Last active Dec 16, 2015
Embed
What would you like to do?
<?php
class XSession extends Phalcon\Session\Adapter implements
Phalcon\Session\AdapterInterface,
Phalcon\DI\InjectionAwareInterface
{
protected $_dependencyInjector;
public function setDI($di)
{
$this->_dependencyInjector = $di;
}
public function getDI()
{
return $this->_dependencyInjector;
}
public function x()
{
$cookies = $this->getDI()->get('cookies');
$cookie = $cookies->get('cookie_name');
var_dump($cookie->getValue());
}
}
$di = new Phalcon\DI\FactoryDefault();
$di->set('session', function() {
return new XSession();
});
$session = $di['session'];
echo $session->x();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.