Http requests from a servlet in a plug-in can invoke the request.getSession() and get a wrapper for the session:
What is the session object wrapped? Is it related in any way to the user http session in JIRA? Or are plug-ins stateless and are such wraped sessions dummy instances?
Hi you can use httpSession in your plugin.
your running with Request object then you can store in the session.
this way you can try in your servlet make sure you set some value to session.
Just that brings up this related question:
setting attributes just in the way you mentioned is not working.
I've also seen that request.getSession().getId() returns different values across servlet calls, like whether a new session instance is created and wrapped per servlet GET/POST call. :(
On the other hand, I know working with session attributes is a quite common feature used by many plug-ins and it should work, but honestly I debugged the classes provided by the atlassian-plugins-servlet-2.10.1.jar (which is bundled with JIRA 5.1) and they looks like wrapping all the servlet related objects like request, response , session... and my bet is that the session wrapper does not keep a singleton instance to manage the plug-in session, in other words: attributes are lost because they are copied to the "A" session instance and read from the "B" instance and the plug-in framework does not copy the attributes from A to B instance.
Maybe this might be related:
It's not exactly the same case (JIRA session is not closed), but the issue mentioned in this thread happens every time that the plug-in performs a log (Http basinc authentication) in a 3rd party application. Might that cause session lost in plug-in?.
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG