for zend/session I use this:
$populate = array(‘foo’ => ‘bar’);
$config = new StandardConfig();
$config->setOptions(array(
‘save_path’ => ‘/home/[username]/public_html/blah’,
‘use_cookies’ => true,
‘cookie_lifetime’ => 3600,
‘name’ => ‘zf2’,
‘cookie_httponly’ => true,
‘gc_maxlifetime’ => 3600,
));
/*
$config = new SessionConfig();
$config->setOptions(array(
‘hash_function’ => ‘sha1’,
‘use_trans_sid’ => true,
));
*/
$manager = new SessionManager($config);
$manager->setStorage(new SessionArrayStorage($populate));
$manager->getValidatorChain()->attach(‘session.validate’, array(new HttpUserAgent(), ‘isValid’));
//$manager->getValidatorChain()->attach(‘session.validate’, array(new RemoteAddr(), ‘isValid’));
However I don’t get an error, and I see I have sessions by print_r($_SESSION) but it seems that $config this is not working for me. e.g. I don’t see a name zf2 as specified above but if I change the path to a folder that does not exist I get an error but if exists I see nothing in folder. I don’t see any cookie too. when changing to another $config and set hash_function to blah I get an error as expected, and sha1 and md4 are fine. so I think it is reading my $config, so why I don’t see a cookie name zf2 or no file in that path? plz advice
http://framework.zend.com/manual/2.3/en/modules/zend.session.config.html