Hi experts,
I am working in an AEM app which does following -
This works in single nodes (like author, publish etc), but when I am dealing with the web server it doesn’t. I am not able to collect the session data. I have 2 author, 2 pub nodes and 1 web server.
Here is the form action script
submiForm.jsp
<%
String str=request.getParameter("bnfname4");
request.getSession().setAttribute("data", str);
%>
Here is the createfile.jsp
<%
String txt=(String)request.getSession().getAttribute("data");
%>
Any idea??
Views
Replies
Total Likes
Have you set up sticky connections ??
If you are managing sessions between 2 pub instance with 1 web server, you need to configure the sticky connection in the dispatcher
Views
Replies
Total Likes
You definitely have to use sticky connection to address this issue, as Loki said. I guess from AEM 6.2 we dont have to use sticky session anymore with these kind of scenarios. Am I correct @bsloki.
Views
Replies
Total Likes
Hello Tuhin,
Using server side session is not recommended in AEM, you can not cache pages and use proper load balancing if server side session is enabled. Would recommend to save this data to either client context or cookie or query param or Use some kind of session storage (couch base or something). Long run it will help you.
Yogesh
Views
Replies
Total Likes
Yogesh Upadhyay wrote...
Hello Tuhin,
Using server side session is not recommended in AEM, you can not cache pages and use proper load balancing if server side session is enabled. Would recommend to save this data to either client context or cookie or query param or Use some kind of session storage (couch base or something). Long run it will help you.
Yogesh
Hi Yogesh,
I totally agree with what you are saying. But if I am not wrong we are not form pages are not cached, right? And if the data is not heavy would sticky connection be creating so much performance overhead. It would be only for the forms pages nevertheless. The rest of the pages would be cached. Please correct me if I am wrong.
Thanks
Tuhin
Views
Replies
Total Likes
Thanks yogesh.
We can not use query parameter as the data is a long string and little sensitive.
When you say COOKIE, I tried this in my JSP-
Cookie cookie = new Cookie("key","value");
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies