Hi Everyone,
I am working on a custom module and added a 'Logout' link in the menu of the module. When I hit the logout link, instead of getting back to the user login page or 'Access Denied' page, I am getting a 'too many redirects' error in the browser and the website becomes unusable from that point unless I remove my module code from the Drupal installation directory.
I am wondering why is it getting into a redirect loop. After I hit the logout link, the user's session is destroyed it gets redirected to the same page. Since there is no user session now, it should atleast give me the 'Access Denied' page. Can anyone shed some light and give me pointers on why this could be happening?
Thank you.
Comments
could you give the function
could you give the function you have created..
i mean the function that runs when hitting the logout button so i can see what triggers those error.
Marc Jones Dinero
Drupal Web Developer/Themer
Promet Solutions, Inc.
1802 W. Berteau Ave., Unit 209
Chicago, IL 60613
Mobile: +63 9494906965
YIM: dinero_marc
Skype: mjonesdinero
Drupal Web Development
Hosting
Online Marketing
Hi Jones, I did not create
Hi Jones,
I did not create any custom function that runs on hitting logout button. The logout button just redirects the user to 'http://localhost/mysitename/logout' link which is the normal logout link.
Here is the custom menu code that we have
function mymodule_preprocess_my_menu(&$vars) {
global $user;
$account = user_load($user->uid);
$links[] = array('title' => 'Log Out', 'href' => 'logout');
$vars['links'] = theme('links', $links, array('class' => 'menu'));
}
This module is working fine in a different environment of ours, but having issues in the environment which I have setup for my testing. The module code is same in both the environments. Just to verify if there are issues with destroying the user session, I have put a watchdog statement after the session_destroy() function in 'user' module. I am able to see my watchdog statement, so I am assuming that there are no issues with destroying the user session. I am kind of lost on where to look further. Please let me know if there is any other information that you would like to know.
Thanks a lot for your help.
maybe there are some conflict
maybe there are some conflict that making this kind of issue.. are there any difference between the two environments you have?
Marc Jones Dinero
Drupal Web Developer/Themer
Promet Solutions, Inc.
1802 W. Berteau Ave., Unit 209
Chicago, IL 60613
Mobile: +63 9494906965
YIM: dinero_marc
Skype: mjonesdinero
Drupal Web Development
Hosting
Online Marketing