php-mongo-session
php-mongo-session copied to clipboard
Added support for apps using namespaces
For coherency, I had to place the class into a namespace (not included in this fix of course).
Prior to the fix, class_exists('MongoClient') would fail, as MongoClient was not in the same namespace, hence the change to class_exists('\MongoClient').
Two issues were fixed regarding session timeout:
- cookie was not set
- session.gc_maxlifetime was not set using the right option
Thanks for this awesome class!
Hi @philrykoff thank you for your contribution.
Regarding the namespaces, I'm still maintaining PHP 5.2.17+ support at this moment so the code needs to make this check carefully since \MongoClient
isn't a valid classname prior to 5.2.17.
However, unless a namespace
is declared, there should be no issues with classes not used with the full namespace:
php > class_exists('MongoClient');
php > var_dump(class_exists('MongoClient'));
bool(true)
php > var_dump(phpversion());
string(5) "5.6.3"
php >
I would ask that you verify that you have the mongo extension loaded and running.
I would also ask that you split up your PR and separate the cookie/session settings and I will merge that.
Hey @nicktacular - done!
@nicktacular, merge please