How can I login (i.e. set current user) from PHP script? There is get_current_user() function, there is even posix_getpwnam() to retrieve extended user information, but I could not find anything that would enable me to change the user (supplying the UNIX password, of course).