Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

HttpSession issues in AEM 6.2


Level 2


I am in the process of migrating a project from 6.1 to 6.2 . In the process I am having some issues with HttpSession. Here is the scenario :

1) User logins in from login page  -  Ajax call made to server and required data pulled from backend service and userId put in a session variable.

2) Post login user redirected to user home page - In this page there are multiple components each having its own ajax call to get necessary data. These calls need the userId saved in session in Step1.

The Step2 is failing because for each ajax call SlingHttpServletRequest is returing a new HttpSession which does not have the userId. Even in debug window, I can see that the HashCode of each of the session objects is different.  This same code used to work in 5.6 and 6.1 as well.

Does anyone have any idea what is going on or is there something new in 6.2 server which I might be missing ?

Thanks !!

0 Replies


Level 2

Same thing here. Code that has worked since 5.6.1 for 3 years fails on 6.2:

request 1: request.getSession().setAttribute("key", "value")

request 2 (on single author, no cluster): request.getSession().getAttribute("key")  // null 

Please help!



Seems like an issue. Can you open up a case with AEM Daycare Team requesting a fix for the same ? 


Level 4

I agree, fike a ticket. Code that used to work should work. Othetwise it must be documented. Either way, there is a bug.



Is there any reason why you cannot store this information in a cookie rather than using the http session? This way you would not require sticky connections either for multiple publish instances.