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.
Options

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

GaryFunkGaryFunk Senior Application Developer ✭✭

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

  • Options

    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.

  • Options
    GaryFunkGaryFunk Senior Application Developer ✭✭

    @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.

  • Options
    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.

  • Options
    GaryFunkGaryFunk Senior Application Developer ✭✭

    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.

  • Options

    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.

  • Options
    GaryFunkGaryFunk Senior Application Developer ✭✭

    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.

  • Options
    GaryFunkGaryFunk Senior Application Developer ✭✭

    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.