I am looking for a way to delete a user when they logout and when session expires…whatever one happens first?
Reason being is that all login authentication happens through an api to another company and checks if the user is a registered user with that company. Then the login will give them WP login authentication. All of this works, but I now want to delete users when they log out or when their session expires.
Thanks.
3 comments
Comments are closed.
So this is what I did…also keep in mind this is for a multisite and I am call calling this within a class. ‘Client’ is a custom user role that is create and given to users when they are created.
I do have one question…this works when the user logs out, but when will it run on its own. When the cookie times out?
there you have mistake, you should have:
I think first you have to update a meta before user makes logout.
There will be a function that will run in init hook which will check for the meta value.
If that meta value is present then it will remov the user whose id has that meta key value pair.