Use session and fix a bug

- Use session to carry the code
- Fix a bug when there are two tempToken with same code