Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

what is the event fired on sign-out and sign-in with cookie

I am looking for the events that get called when a user signs out and the cookie gets destroyed and the session ends. Then the event that is called when a user signs on with a cookie and the session is created.

I need this to create and destroy a custom cookie.

Comments

  • There is no sign out as such, the session is just nulled.

    You might wan to look at my One Session plugin and also the other connects plugins.

    I presume you are doing some sort of SSO

    You have EntryController_SignIn and Base_AfterGetSession but there is more to it than that. I mean you can always detect whether there is an active session/user with Gdn::Session()->IsValid(), so take you pick which you wish to use. You probably are going to want to use something like Base_AfterGetSession or a combination of the two.

    grep is your friend.

  • @x00 That is exactly what I am doing. I just added public function EntryController_SignOut_Handler($Sender, $Args) to see what I blow up.

    I need to have a function called in my plugin so I can add or delete a cookie when the user logs out, or logins in with other than the SSO.

    Thank you for guidance. I am still trying to get a handle on these events.

  • x00x00 MVP
    edited January 2013

    You need to detect whether the session exists. it is not really enough to rely on controller methods and there isn't a sign out event.

    grep is your friend.

  • I am using 2.1a and the EntryController does have a BeforeSignOut and a SignOut. I am using BeforeSignOut and it is doing exactly what I want.

    Now I am working with AfterSignIn and that does not seem to be called in my plugin. I am going to try a few other things.

    Thanks for the help.

  • At the end of the day it is better just to check the session. What if the session just expires and the is no sign out?

    grep is your friend.

  • In the end, I went with AfterGetSession. I see that it is being called twice but that really doesn't matter much to me at this time.

    Now to find a call to the query I want.

  • A BIG thanks to @x00 for his suggestions. I have everything in place and it's working well. Also to @businessdad for his logger. It is nice seeing what happens on the server.

Sign In or Register to comment.