Project

General

Profile

Logout using custom button

Added by ViNotion BV over 11 years ago

Hi,

In my application, authentication is implemented using a Wt::AuthWidget. After a user has logged in, I want to create a custom 'logout' button, instead of using the Wt::AuthWidget.

To this end, I created a button which is connected to the Wt::Auth::Login::logout() function. This usually works fine, however when a user has selected the 'Remember me' checkbox, clicking the logout button does not remove the 'remember me' cookie.

When I use the Wt::AuthWidget on the other hand, the cookie is deleted and the logout functionality works as expected.

Is the Wt::Auth::Login::logout() enough to logout? Or do I need to add something to remove the cookie?

Regards,

Tim


Replies (2)

RE: Logout using custom button - Added by Koen Deforche over 11 years ago

Hey Tim,

No, Login::logout() will simply emit the signal and change login state. Instead you want to call Wt::Auth::AuthModel::logout()

http://www.webtoolkit.eu/wt/doc/reference/html/classWt_1_1Auth_1_1AuthModel.html#a4817022bc0bcc784d7938e0dfa82ed64

Regards,

koen

RE: Logout using custom button - Added by ViNotion BV over 11 years ago

Hi Koen,

Thanks for your response. That indeed fixes my problem, thanks.

Regards,

Tim

    (1-2/2)