replaced username with email in createSession

#1005