I'm so confused! I can't count how many Drupal 5 and 6 sites I've setup and I've never seen this happen. Bear with me but this is not a joke... haha

- I click log out on the admin menu bar, or by going to /index.php?q=logout and it appears to log me out. It directs me to the front page of the site and the admin bar is gone BUT the login box is not displayed telling me that I am not completely logged out?
- I click on any link to take me to another page and the admin menu reappears and notes that I am logged in as the user I was before.
- I have checked the logs and it shows the "session ends" for my user but it never shows that it restarts.

(this is where it gets really weird)

- I use Safari and Firefox to develop. I never use Chrome. I opened Chrome and guess what, I'm logged in! Also logged into safari. I have deleted the sessions manually through phpMyAdmin and it seems to work (the login block displays) but after a few page clicks, I am logged back in WITHOUT LOGGING IN PHYSICALLY.
- I have cleared ALL browser cache. Restarted browsers. Cleared site cache. Turned all Performance > Cache off. Restarted MySQL and Apache.

Here's my setup:
D6.16
MAMP Pro - PHP 5.2.3 - MySQL 5.0.41
PHP Memory Limit - 128M

Comments

interestingaftermath’s picture

Also, during development, I've noticed it just randomly logging me out completely. I never clicked log out, never even cleared the cache. It seems totally random, somehow...

interestingaftermath’s picture

And now I am completely locked out. I login and it loads the admin menu but anything I click on takes me to an access denied page and the admin menu goes away.

interestingaftermath’s picture

And yes, I've tried "Rebuild Permissions"

interestingaftermath’s picture

Also just confirmed my .htaccess file wasn't messed up. I downloaded the Drupal install directory from drupal.org and overwrote the .htaccess file.

interestingaftermath’s picture

no help?

vyasamit2007’s picture

I faced the same things you mentioned in the post this afternoon. Tried everything chache clear and all, googling, etc. but no hope.

Anybody ??

vyasamit2007’s picture

Hey,

I found the solution at my end. I have added a visibility code in a block and there i was using "global $user" and I was checking that if its admin user or not for that I was using "if($user->uid = 1)" this is causing problem. It should be "if($user->uid == 1)".

For your case also it must be somewhere written the same thing "if($user->uid = 1)". Just see in your visibility codes or in your custom module. This line of code will give user a uid 1, so bingo!

I'm surprised how I missed this thing :-) Anyways,

Thanks.

interestingaftermath’s picture

Unfortunately, that is not the case with my issue. I am randomly logged out. I have now transferred the database to the live server thinking that maybe it was just an issue with my local install. Nope. Same thing!

interestingaftermath’s picture

In the effort of giving a full update before I beg for someone to help me, here is where this issue stands:

I have uploaded the files and imported the database to the development server. It was previously hosted on MAMP Pro on my local OS X system. It's now on a Windows machine running IIS.

Here are more specifics to the issue. If I login on the site from the front page, it allows me to login fine. If I try to click on ANY administration pages using the Administration Menu it takes me to a Access Denied page. If, instead of clicking on an admin page link, I click on any other link on the front page it takes me to the page but shows the login block as if I have been logged out.

I am not sure if it's important, but in looked at the site logs there are a ton of Session Opened for [me] entries. There are NO "session closed" entries.

I will pay for the resolution of this issue. Please help!

interestingaftermath’s picture

I HAVE CONQUERED THE ISSUE.

 $user->uid = $node->uid; profile_load_profile($user);
  print $user->{profile_first};
  print " ";
  print $user->{profile_last};

That code was causing the issue. As you can see, this prints the name of the author of the node using the Profile module. I have used this code on almost all of my sites. What I have not done on all of my sites is use the devel auto-generate content option. The auto generated content randomizes the user "posting" the article including Anonymous users. Those users do not have a profile_first and profile_last entry. This logs me out, removes the Logout option from the Admin Menu and then gives me the access denied on whatever page I click on next.

newbie88’s picture

Can I know sir , where is the file I can input the code sir???