wescleveland Posted April 18, 2012 Share Posted April 18, 2012 I am looking for a way to force logout a client and redirect them to a custom url. Is there an API function that can be called to logout the client or end their current session? Any other idea on how to accomplish this? Thanks in advance. 0 Quote Link to comment Share on other sites More sharing options...
laszlof Posted April 18, 2012 Share Posted April 18, 2012 I cant think of an easy way to do this. you'd need to push them to the logout page, and then to the custom URL. However, you cant just push people to URLs without some kind of dynamic connection to their browser session. You could build something using node.js for example. 0 Quote Link to comment Share on other sites More sharing options...
wescleveland Posted April 18, 2012 Author Share Posted April 18, 2012 Thanks for the idea. You got me thinking perhaps destroying the session would satisfy the logout requirement. So, I am playing with: // Force logout by destroying the session session_regenerate_id(); session_destroy(); So far, it seems to do the trick. Not sure if there are any negative ramifications with this approach yet. Will need to perform a WHOLE BUNCH of testing. 0 Quote Link to comment Share on other sites More sharing options...
laszlof Posted April 18, 2012 Share Posted April 18, 2012 Yeah, destroying the session will work fine, but they would need to go to a specific page. I thought you were trying to dynamically logout a client who is currently logged in without their intervention. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.