1. Enter application url in browser, login page is displayed.
2. Login using user1.
3. Check the logged in username, it is of user1.
4. Click Browser back button to go back to the login screen. (don't log out user1)
5. Login using user2.
6. Check the logged in username, it is of user1.
It should be of user2.
so what is the problem which you are facing ? paste some code... clicking on back doesn't do anything... if you have a submit button in your login jsp then it should be submitted with the new user name which you entered, in this case 'user2'.