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

Tagged:

§ One Response to Sessions hook issue in ExpressionEngine Extension

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

What’s this?

You are currently reading Sessions hook issue in ExpressionEngine Extension at Codegeek.

meta

Follow

Get every new post delivered to your Inbox.