core
core copied to clipboard
Session data set by OSGI Servlet gets overwritten for ALL sessions when accessed in velocity
If you set session data in an OSGI Servlet and then access that session data in velocity, the session data gets updated in ALL sessions.
To Reproduce:
- Create an OSGI plugin with a servlet that sets session a session attribute called "testDate" to the current date. (see link below)
- Create a page in dotCMS with a simple widget with the following code:
The Session Date is = $request.getSession().getAttribute("testDate")
- Hit the servlet in Chrome
- Visit that page in Chrome -- Should see the date set from Step 3.
- Visit the page in Firefox -- Should see no date set
- Visit the servlet in FF
- Visit the page in FF -- Should see the date from Step 6.
- Visit the page in Chrome -- Should still see the date from Step 3, but you'll see the date from Step 6.
- Visit the servlet in Chrome
- Visit the page in Chrome -- Should see the the date from Step 9.
- Visit the page in FF -- Should see the date from Step 6, but you will see the date from Step 9.
I have an example OSGI Plugin to test this here: https://github.com/cfalzone/com.aquent.sessiontest
I have a screencast demonstrating the issue: http://screencast.com/t/nYSXYiDgU5
@cfalzone I am pretty sure this is not an issue. I think you have the Page Cache on the HTML Page and that is getting cached
You are correct. It was page cache. :s