Handling drupal_set_message for anonymous users


A. I am facing this very specific problem, Any help would be appreciated.

Everything was working fine untill recently. Now I do not get the New Account Creation Notification on Screen that is displayed to the user. The email gets sent to the user email id but on the screen the user does not come to know that is registration is complete and successfull.

Same for the Forget Password section.

All other messages given by 'drupal_set_message' work. The problem is with these 2 specific messages.
1. New Account Creation Notification on Screen
2. Password Reset Notification on Screen

The only thing that has changed in recent times with the site is that I happened to upgrade the PHP on the server to PHP 5.1.6.

Does that cause any problem?

Please help.


Q. Somehow the anonymous user was deleted from the database. So check to see if you have a uid of 0 still there. If it isn't there, put it back. That cleared up this issue for me. Here is the sql to do it. The question here is, where did that user go, how did it get deleted?

INSERT INTO users (uid, name, mail) VALUES ('0', '', '');
INSERT INTO users_roles (uid, rid) VALUES (0, 1);

I hope this helps someone avoid a long bug hunt.


Worked perfectly for us. A user delete-statement deleted to many users, in our case also the anonymous user.
But when we inserted the user with the insert-statement from above, the new anonymous user got inserted with the uid 6412 or so (because of the auto increment).

So we just changed the uid to 0, and everything worked like a charm.

Thanks a lot.