wordpress.org login page code example
Example: wordpress login programmatically
<?php
clean_user_cache($user_id);
wp_clear_auth_cookie();
wp_set_current_user($user_id);
wp_set_auth_cookie($user_id, true, false);
$user = get_user_by('id', $user_id);
update_user_caches($user);
?>