Are HttpSessions synchronized across multiple publish instances? | Community
Skip to main content
June 13, 2017
Solved

Are HttpSessions synchronized across multiple publish instances?

  • June 13, 2017
  • 2 replies
  • 697 views

I understand that the use of HttpSessions is discouraged in AEM.  If we must use them, will they be synchronized across multiple publish instances if we are not using an enterprise application server and instead using the quick start deployment method?

As a follow up question, is there a way to avoid using HttpSession if we need server side session data for anonymous users?  Everything that I could find online indicates that jcr Sessions are tied to AEM credentials, meaning that 2 anonymous users would retrieve the same session data.

Please note this is AEM 5.6.1.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by joerghoh

Hi,

Without running on an application server, which supports the synchronization of HTTP sessions, HTTP sessions are held only locally and are not shared.

Regarding the "server side data for anonymous user": You should not use the JCR repository to store such data (for a number of reasons). I would try to have it on the clientside as much as you can, and if you need to have them on the server, you the users are probably not really anonymous anymore. Or how do you differentiate one anyonmous visitor from another?

2 replies

smacdonald2008
June 14, 2017

Correct - HttpSessions are not best practice when using AEM.

joerghoh
Adobe Employee
joerghohAdobe EmployeeAccepted solution
Adobe Employee
June 14, 2017

Hi,

Without running on an application server, which supports the synchronization of HTTP sessions, HTTP sessions are held only locally and are not shared.

Regarding the "server side data for anonymous user": You should not use the JCR repository to store such data (for a number of reasons). I would try to have it on the clientside as much as you can, and if you need to have them on the server, you the users are probably not really anonymous anymore. Or how do you differentiate one anyonmous visitor from another?