Ver1 Almost finished (2nd edition)

- added logout mechanism
- fix some bug with cookie