#979502 by a_c_m, Dave Cohen: session save handler patch. Also, avoid unsetting registered user role.