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
BedrockMission!

Learn More

View all

Sign in to view all badges

New HttpSession on Every Request

Avatar

Avatar
Validate 1
Level 2
Reini-
Level 2

Likes

4 likes

Total Posts

21 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 3
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 2
Reini-
Level 2

Likes

4 likes

Total Posts

21 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 3
Boost 1
Affirm 1
View profile
Reini-
Level 2

29-07-2016

Hi,

I can't set any session attributes, because I get a new HttpSession on every request. To validate this, I added <%=slingRequest.getSession().getId()%> to /apps/geometrixx/components/homepage/content.jsp. Now I can see the http session id on every request to http://localhost:4502/editor.html/content/geometrixx/en.html. And I can see, this Id changes for every request so it makes no sense to set any session attributes like request.getSession().setAttribute("...", "....").

Can anybody tell me, how to get a valid http session which does not change for every single request?

Environment: Standard AEM 6.2 on Windows

 

regards

Reini

View Entire Topic

Avatar

Avatar
Validate 1
Level 2
Reini-
Level 2

Likes

4 likes

Total Posts

21 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 3
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 2
Reini-
Level 2

Likes

4 likes

Total Posts

21 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 3
Boost 1
Affirm 1
View profile
Reini-
Level 2

03-08-2016

Hi Opkar,

I know all the problems with dispatcher, sticky connections, ...
But in my case the anonymous user can choose between different shops, and every single shop has different prices, different stock level, ..., but the URL of the product pages stays the same (the url does not change after you select another shop, but some values on the page must change). So I tried to save the selected shop (and also some other values the user can select) in the session. On the product page I request the non static values with an ajax request (the rest of the page can be cached in dispatcher) and in this request I read the selected values from the session. But as mentioned in the previous post I changed this behaviour and I save the selected values in a cookie now and it also works.

regards
Reinhard