To switch the user's default project (and thus create a new task) as part of simulating a login, type the following:
# su - user
To retain the project ID of the invoker, issue su without the - flag.
# su user