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

Member log out using PHP

Development and Programming

Sean Delaney's avatar
Sean Delaney
64 posts
15 years ago
Sean Delaney's avatar Sean Delaney

I am trying to logout a member using PHP by clearing their session however I cant see any options to unset a session in the Session class documentation.

I can see all the session data here: $this->EE->session->userdata but how can i clear it ?

The reason I’m doing this is I need to create a custom login / logout form for a client and they do not want to use the default templates used by EE.

Please advise

       
Jack McDade's avatar
Jack McDade
425 posts
15 years ago
Jack McDade's avatar Jack McDade

You should just be able to use

<a href="http://{path=LOGOUT}">Log Out</a>

.

       
Sean Delaney's avatar
Sean Delaney
64 posts
15 years ago
Sean Delaney's avatar Sean Delaney

Yes, I know but I want to do this using PHP. Is it possible ?

       
PressEnter Creative's avatar
PressEnter Creative
235 posts
15 years ago
PressEnter Creative's avatar PressEnter Creative

You can update those default templates for the “You’re Now Logged In” and “You’re Now Logged Out” pages in EE2 by going to Design > Message Pages > User Messages.

       
the3mus1can's avatar
the3mus1can
426 posts
15 years ago
the3mus1can's avatar the3mus1can

Have your tried:

$this->EE->functions->redirect($this->EE->functions->create_url('?ACT=10'));

This will essentially do the same as clicking on:

<a href="http://{path=LOGOUT}">Log Out</a>
       
Sean Delaney's avatar
Sean Delaney
64 posts
15 years ago
Sean Delaney's avatar Sean Delaney

Thanks the3mus1can!

       

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.