Sessions hook issue in ExpressionEngine Extension
June 14th, 2010 § 1 Comment
I was creating a custom extension of expressionengine 1.6.x version where i tried to use sessions_start and sessions_end hooks but i was facing problem with $SESS global var, it was not loaded to extension method. The method was something like -
function do_something(){
global $SESS;
print_r($SESS);
}
I wasted about 1/2 hours with this but no clue why this happened. Later i saw that, this hook is called with instantiated object(session) $this as parameter, so later i defined that function as -
function do_something($sess){
print_r($sess);
}
It solved and shows session data. Its very easy but sometime time wasting issue. Hope this will help EE community.
Advertisement
I’m running into this same exact problem in expression in ee2. I’m new to this CMS. You have any idea how to load in the session data with the hook in this version?