This method logs out the current user of the Gigya platform. 

Description

 

This method logs out the current user of the Gigya platform. We highly recommend calling this method when the user logs out of the hosting site.
Note that this method does not disassociate the user from the providers, it merely indicates that the user is logged out. The user's site account remains associated with any connected social accounts, even when logged out and even if the Gigya service is unavailable. When the user logs in again, full access to all the previously connected providers is restored, i.e., the association remains.

 

REST API > socialize.logout.

 

 

RequiredNameTypeDescription
callbackfunction
cidstring
forceProvidersLogoutBoolean
contextobject

 

FieldTypeDescription

  

Triggered Global Event

By using this method the following global event is triggered: onLogout. To register an event handler use the socialize.addEventHandlers API method. Please refer to the onLogout event data. Refer to Events to learn more about how to handle events generated by the Gigya service.

 

Code Sample

function printResponse(response) {    
    if ( response.errorCode == 0 ) {               	 
        alert('User has logged out');  
    }  
    else {  
        alert('Error :' + response.errorMessage);  
    }  
} 

gigya.socialize.logout({callback:printResponse});