How to access session from different context?
I have created a session in one jsp, in one context and trying to access it from different context. But, I was unable to access the same. How to achieve it?
Cross context calls have to be explicitly allowed. Have you managed to configure your system to allow cross context calls?
Do you get a result from call to servletContext.getContext(...)
The next issue becomes then obtaining a session from the other context.
The API for retrieving sessions by ID was removed for security reasons. You can duplicate that functionality using sessionListeners storing sessions as they get created.
Most probably the solution would require keeping a map of user->session in application scope.
But this is all getting complicated. I would query your base design if you need to jump through hoops like this.