Trongate Docs
switch to dark modeswitch to dark mode
»
»
Destroying Tokens (PHP Friendly Version)

Destroying Tokens (PHP Friendly Version)

There may be situations where have to delete a token from a user's device - for example, if a user has decided to log out of a private members' area.  Destroying tokens can be achieved by invoking the _destroy() method, which is on the trongate_tokens module.  This method requires no arguments.

Below is an example of the destroy method being invoked.

$this->module('trongate_tokens');
$this->trongate_tokens->_destroy();

Just To Let You Know
This method clears any tokens that might potentially be stored as either session data or cookie data on the user's device.  In instances where the user was found to have a token, the method will also delete records from the 'trongate_tokens' table that correspond with the user's token.

Just To Let You Know
If the _destroy() method is invoked in instances where the end user does not have a valid token then nothing whatsoever will happen, and no error messages will be produced.





HELP & SUPPORT

If you have a question or a comment relating to anything you've see here, please goto the Help Bar.

 
×