added session storage and refernces to templates once login is successfull