wp_login
hook provides access to two parameters: $user->user_login
(string) and $user
( WP_User ). To pass them into your function you will need to add a priority (default is 10) and request 2 arguments from the add_action() call:
function login_cookie($user_login, $user) {
global $wpdb;
var_dump($user); // get WP_User object
//Get current user ID
$id = $user->ID;
.....
}
add_action( 'wp_login', 'login_cookie', 10, 2 );