Simulate a full login. The environment and umask are set to what would be expected if the user actually logged in again.
If the group operand is present, a new shell is started with the specified effective and real group IDs. The user will be prompted for a password if they are not a member of the specified group.
Otherwise, the real, effective and supplementary group IDs are restored to those from the current users password database entry.