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

EE 2.2.1 Session Variables Changed?

Development and Programming

c@sey's avatar
c@sey
40 posts
14 years ago
c@sey's avatar c@sey

Were there any major core changes to the way EE handles sessions in 2.2.1? I recently updated and my aMember logins no longer works.

The user is created and I’ve added this to the top of index.php:

session_start();

Should I add this somewhere else as well?

       
c@sey's avatar
c@sey
40 posts
14 years ago
c@sey's avatar c@sey

From the 2.2.0 changelog:

Altered Sessions handling and removed the uniqueid and userhash cookies.

Can anyone elaborate on this a little so I can find what needs to be modified on my end?

This is my code that has stopped working:

function after_login($user){
//        if ($this->logged_in_from) return;
        $u = $this->get_user_by_login($user['login']);
        if ($u['password'] != $this->crypt($user['pass'])) return;
        if ($u['group_id'] == 0) return;
        $this->set_cookie("exp_userhash", $u['password']);
        $this->set_cookie("exp_uniqueid", $u['unique_id']);
    }

I am using ‘cookies only’ for front end logins. I really need to figure out how to set the cookie using the new cookie data, but I can’t find anything in the dev docs.

       
John Henry Donovan's avatar
John Henry Donovan
12,339 posts
14 years ago
John Henry Donovan's avatar John Henry Donovan

c@sey,

How does a login from aMember typically work? Can you elaborate on this a bit more as unfamiliar with it. Is there an extension or do you need to add all this manually? Where do you add that function?

       
jeffmace's avatar
jeffmace
120 posts
14 years ago
jeffmace's avatar jeffmace

I didn’t pick up that this was being done. I used the uniqueid cookie to tie in an outside application. I was wondering why it stopped working this morning since I just updated to 2.2.2 last night. Is there a way for me to add this in or utilize the uniqueid in some way so that it can be passed via cookie, session, etc.

       
Kevin Smith's avatar
Kevin Smith
4,784 posts
14 years ago
Kevin Smith's avatar Kevin Smith

Hey c@sey and jeffmace,

I’m sure this must be frustrating for you, however, since our API regarding sessions didn’t change and your code connects directly to these now deprecated cookies, this is a question better suited for the Development & Programming forum.

One thing I will note is that session_start() is a PHP-native function. EE is built on top of CodeIgniter which uses its own session class and does not make use of native PHP sessions.

       

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.