Initiating a session and keeping a session for each user can be problematic, sometimes. Especially, if you are doing this manually. However, general idea is simple. You need to put each coming request to a filter which checks whether request has a valid session or not. In this article, I…