Use Session to control UI state.
Add login control.
Move access to database to server.