I need to log a user out and redirect to a URL.
How would I do that in Drupal 7?
Thanks
I need to log a user out and redirect to a URL.
How would I do that in Drupal 7?
Thanks
You should call user_logout()
.
drupal_goto()
calls user_logout()
anyway. –
Adapt use this any where
<?php
module_load_include('pages.inc', 'user');
user_logout();
?>
Another option is using the Rules module. You can set a rule up to redirect to a URL after a user logs out and various other rules if needed.
© 2022 - 2024 — McMap. All rights reserved.
drupal_goto()
– Duckpin