We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Editing variables with extensions

Development and Programming

Wired's avatar
Wired
181 posts
17 years ago
Wired's avatar Wired

How would I go about editing the values of for example core.session.php after I call the hook?

For example how would I access $this->userdata from core.session.php from within my extension ext.edit_session.php ?

       
Jamie Poitra's avatar
Jamie Poitra
409 posts
17 years ago
Jamie Poitra's avatar Jamie Poitra

Wired,

I believe it is as easy as taking the data the extension gives you which includes everything in the Session class and returning it back when you are done messing with it.

So you call the ‘sessions_end’ hook in your extension. That hook hands off $this to you your extension. So you could do something like this in the method function of your extension:

function extend($session)
{        
    $session->userdata['member_id'] = 50;
    
    return $session;        
}

Making sense?

Jamie

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.