creating log in functionality through sessions