For caching you need to use any third party free wares like open symphony. Once the user logs in to the application, you create an object with the user information. this object resides in the cache till user logs out of the application. If the user requests to login into the application then check in the cache for the object. if exists does not allow, otherwise log the user in.
Hope this is helpful.