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

EE4 - Programatically log in user

Development and Programming

David Hyland's avatar
David Hyland
210 posts
7 years ago
David Hyland's avatar David Hyland

Hi there.

Following this thread I’m trying to programatically log in a user on accessing a certain template with a hash in the URL which is used to look up the member ID. At the moment I’m using the “session_start” hook in EE 4.2.1 but this just throws the following error …

Exception Caught
No such property: 'session' on EllisLab/ExpressionEngine/Legacy/Facade
ee/EllisLab/ExpressionEngine/Legacy/Facade.php:114

Stack Trace: Please include when reporting this error
#0 ee4system\ee\EllisLab\ExpressionEngine\Legacy\Facade.php(29): EllisLab\ExpressionEngine\Legacy\Facade->get('session')
#1 ee4system\ee\legacy\libraries\Auth.php(719): EllisLab\ExpressionEngine\Legacy\Facade->__get('session')
#2 ee4system\user\addons\custom_extensions\ext.custom_extensions.php(53): Auth_result->start_session()
etc

I assume this is because this has changed in EE4 so what would I need to do with EE4 to do this with a member ID? Or would a different hook work better?

I am aware of the potential risks involved in programatically logging in a user but the client has asked me to research this idea so there it is.

Thanks!

       
chuoiit16's avatar
chuoiit16
1 posts
6 years ago
chuoiit16's avatar chuoiit16

, This is a great article. It gave me a lot of useful information. thank you very much. Link profile: https://dakhoaauahcm.vn/benh-cham-la-gi.html

       

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.