Pearl1594 commented on a change in pull request #4166:
URL: https://github.com/apache/cloudstack/pull/4166#discussion_r444640486



##########
File path: server/src/main/java/com/cloud/api/ApiServlet.java
##########
@@ -259,6 +259,22 @@ void processRequestInContext(final HttpServletRequest req, 
final HttpServletResp
                 userId = (Long)session.getAttribute("userid");
                 final String account = (String) 
session.getAttribute("account");
                 final Object accountObj = session.getAttribute("accountobj");
+                if (session.getAttribute(ApiConstants.SESSIONKEY) != null) {
+                    Cookie[] cookies = req.getCookies();
+                    if (cookies != null) {
+                        HttpSession finalSession = session;
+                        List<Cookie> sessionKeys = 
Arrays.stream(cookies).filter(cookie ->  
cookie.getName().equals(ApiConstants.SESSIONKEY)
+                                && 
cookie.getValue().equals(finalSession.getAttribute(ApiConstants.SESSIONKEY))).collect(Collectors.toList());
+                        Cookie validCookie = sessionKeys.get(0);

Review comment:
       When there are 2 sessions opened (primate and legacy UI) to the same 
domain, there will be multiple sessionkey cookies




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to