Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 363367 - Need access to HTTP session from EGL-generated services and libraries
Summary: Need access to HTTP session from EGL-generated services and libraries
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: EDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-09 13:57 EST by Will Smythe CLA
Modified: 2017-02-23 14:19 EST (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Will Smythe CLA 2011-11-09 13:57:09 EST
Need the ability to set and get HTTP session variables from a library or service running under a Web container, like Tomcat. I should be able to have multiple EGL (and Java servlets) deployed into the same web app and share data via the HTTP session.

(Note: this may be a good time to look into the issue that Aaron from ClearBlade reported about 2 EGL services in the same web app not getting the same session ID, which prevented them from sharing data via a session). 2 Java servlets sitting in the same web app (which is essentially what EGL-generated services are) should be able to share HTTP session data (i.e. a request from a RUI app in a browser instance should look like the same session to both services).

I would expect the behavior for session get/set to work the same during development time (via the IDE Test Server) and on a 'real' server like Tomcat.
Comment 1 Brian Svihovec CLA 2011-11-09 15:01:30 EST
I talked with Joe about this, and he told me the following:

1) Issue from ClearBlade - This support does not exist in RBD, and would involve a non-trivial change to make it work.  A second work item should be opened and marked 'future' for this issue.  Also, a workaround was provided for this issue in RBD, which should still be relevant in EDT .7.

2) Set and Get HTTP Session variables - The list of features provided for EDT .7 does not include JEELib, which is where this functionality would be located, so no investigation has been done yet for porting this library to EDT.  While on the surface the changes to add this functionality seem trivial, there is a lot of code that would need to be ported, reviewed, and tested.  Also, Justin would need to review the design to confirm that the solution would work on the IDE Test Server as well.  Due to the fact that Joe will be unavailable after tomorrow, and based on the original assumption that JEELib will not be part of EDT .7, I believe we will need to defer this feature until after .7.  If you do not agree with this assessment, please provide a specific example of an application that must work in the .7 time frame and will not work without this feature.
Comment 2 Will Smythe CLA 2011-11-09 15:13:15 EST
This can wait until after .7, but needs to be high on the list for 0.8. We definitely need to solve #1 soon -- the current behavior is not consistent with the way session normally works. A single client instance (i.e. RUI app running in a browser) calling EGL-generated services running in the same web app should share a common session.
Comment 3 Joseph Vincens CLA 2012-04-18 16:40:48 EDT
080 has the ability to access the HttpSession, but there is a problem with the EVServer talking to the jetty server.
HttpSession is an ExternalType so you have access to all the HttpSession functionality.
The 1 problem in 080 is with the test server when using a dedicated or workspace bound service. The server issues a set-cookie which does not propagate through the EVServer. I recently resolved this the set-cookie issue so 081 will support HttpSession from development through to deployment. 

For 080 I had planned to write a blog about accessing and maintaining the session, but because of the jetty server issue this will have to wait until 081.

org.eclipse.edt/ibmi/org.eclipse.edt.jtopen.samples contains a code example for accessing the HttpSession. See the SessionConnectionsLib.getSessionId to see how to obtain the session.

org.eclipse.edt/ibmi/org.eclipse.edt.ibmi.examples contains sample code for extracting the set-cookie and putting it on the HttpRest variable. See the CookieSession library, it extracts the the set-cookie and puts it in the request headers.