Login saved in session
More JS refactoring