Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KEEP_SESSION_ALIVE set to false not respected #8238

Closed
levosgien opened this issue Oct 13, 2015 · 6 comments
Closed

KEEP_SESSION_ALIVE set to false not respected #8238

levosgien opened this issue Oct 13, 2015 · 6 comments

Comments

@levosgien
Copy link

Reference: https://my.dotcms.com/ticket/dotcms-109/

We tried setting the KEEP_SESSION_ALIVE dotmarketing-config property to false. It looks like this was originaly intended to time the user out after 30 mins and redirect them to the login page. Our experience has been that whilst it does redirect them to the login page they then just get redirected straight back in.

If you have KEEP_SESSION_ALIVE set to true it does a keep alive call every 15 mins. I suspect the problem is that there is now a call to /api/notification/getNewNotificationsCount/ every 5 seconds so this is always keeping the session alive now regardless of the KEEP_SESSION_ALIVE property. So I think something needs to change there if you still want KEEP_SESSION_ALIVE to work following the addition of the notifications check.

@jtesser
Copy link
Contributor

jtesser commented Oct 13, 2015

yea probably the notification is keeping this up.

@wezell
Copy link
Contributor

wezell commented Oct 13, 2015

yeah, I guess the solution is - if you have KEEP_SESSION_ALIVE set to false, only call the checkNotifications on page refresh. The problem is the whole notification API needs a user, which comes from the session

@jtesser
Copy link
Contributor

jtesser commented Oct 13, 2015

Yea there are other solutions but they are not pretty :-p

joseorsini added a commit that referenced this issue Oct 15, 2015
@trigfoot
Copy link

Hi,

I don't think the proposed fix will work as there are other calls to the server in the page after the setTimeout("checkNotifications()",60000 * 30) that will restart the session timer, so when this notifications timer hits 30 mins the session won't quite have expired yet and this call will just cause the session timeout to be extended by another 30 mins.

This is the fix we attempted in nav_sub_inc.jsp:

checkNotifications();

<% if(Config.getStringProperty("KEEP_SESSION_ALIVE").equalsIgnoreCase("true")) {%>
    // Call Every 5 seconds
    window.setInterval(function(){
        checkNotifications();
    }, 5000);
<% } %>

So the notification check is done when each page is first displayed, then not again until the user goes to another page (if KEEP_SESSION_ALIVE is false).

This works fine in Chrome/Firefox, but we seem to have a separate issue with IE. (See 2. in my support ticket ah-15.) Even after the session should have expired, users continue to stay logged in in IE. After the session timeout period has passed and no check notification calls made in that time, if you go to a new page the JSESSIONID changes to a new one and the user still continues to stay logged in. Instead of the session expiring as with the other browsers, in IE it looks like it is continuing the same session just with a new JSESSIONID. Any ideas why? Thanks.

@joseorsini
Copy link
Contributor

Session invalidation in IE is not working even if KEEP_SESSION_ALIVE is set to false.

Tested on 3.2.3/Postgres 9/Java 8/IE 11.

Session timeout was changed to 5 minutes in the bottom_portal_inc.jsp so the time wait is shorter (only for testing purposes).

At login:

screenshot-1

After "Session Expired" alert was shown and it attempts to redirect to backend login page.
screenshot-2

Tested a potential fix for this (in 3.2.3), so sessions are invalidated for all Browsers if the Keep-Session-Alive property is set to false.

IE 11 During Active Session
ie-after-fix-1

IE 11 After "Session Expired" message is displayed. Notice the changes on Server cookies
ie-after-fix-2

Chrome 46 During Active Session
chrome-after-fix-1

Chrome 46 After "Session Expired" message is displayed. Notice the changes on Server cookies
chrome-after-fix-2

jtesser pushed a commit that referenced this issue Oct 23, 2015
…for-notifications-api-call-part-2

proposed fix #8238
@joseorsini
Copy link
Contributor

PR: #8254

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants