If you actually do want to act as the user you are loading, it is essential to call

 session_save_session(FALSE);

first. See Safely impersonating another user for more information.

session_save_session() doesn't exist in d7.

CommentFileSizeAuthor
#3 1031686.patch950 bytesrschwab
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

cweagans’s picture

cweagans’s picture

Per this link, it should now be drupal_save_session()

http://drupal.org/node/218104

rschwab’s picture

Title: Documentation problem with user_load » User_load documentation should reference drupal_save_session, not session_save_session
Status: Active » Needs review
FileSize
950 bytes

Yep, this is a true story. A grep confirms this is the last place session_save_session is referenced in D7.

cweagans’s picture

Status: Needs review » Reviewed & tested by the community

That'll do it. This patch can be committed to 7 since it's just a doc fix, right?

jhodgdon’s picture

I second the motion on this patch.

Dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to CVS HEAD. Thanks.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.