core icon indicating copy to clipboard operation
core copied to clipboard

Session data set by OSGI Servlet gets overwritten for ALL sessions when accessed in velocity

Open cfalzone opened this issue 12 years ago • 2 comments

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:

  1. Create an OSGI plugin with a servlet that sets session a session attribute called "testDate" to the current date. (see link below)
  2. Create a page in dotCMS with a simple widget with the following code:

The Session Date is = $request.getSession().getAttribute("testDate")

  1. Hit the servlet in Chrome
  2. Visit that page in Chrome -- Should see the date set from Step 3.
  3. Visit the page in Firefox -- Should see no date set
  4. Visit the servlet in FF
  5. Visit the page in FF -- Should see the date from Step 6.
  6. Visit the page in Chrome -- Should still see the date from Step 3, but you'll see the date from Step 6.
  7. Visit the servlet in Chrome
  8. Visit the page in Chrome -- Should see the the date from Step 9.
  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 avatar Jun 04 '14 16:06 cfalzone

@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

jtesser avatar Jun 04 '14 17:06 jtesser

You are correct. It was page cache. :s

cfalzone avatar Jun 04 '14 19:06 cfalzone