Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Steve Morgan 1349 posts 4458 karma points c-trib
    May 14, 2015 @ 12:04
    Steve Morgan
    0

    Member (Front end) Session Keep Alive

    I have a user that might be on a page for a long time (watching a video). Is there an easy Ajax call I can make to stop the member session logging out. 

    I'm considering a simple ajax get which just checks something on the member service - will this be enough to keep it alive. I'm off to test this myself but wondered if someone knows the answer already?

    Steve

  • Simon steed 376 posts 688 karma points
    May 14, 2015 @ 12:13
    Simon steed
    0

    You can extend the session timeout from the web.config - just extend the timeout value:

    <sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes" cookieless="false" timeout="60" />

  • Steve Morgan 1349 posts 4458 karma points c-trib
    May 14, 2015 @ 12:34
    Steve Morgan
    0

    Thanks Simon - that would work but I'd rather not raise this value just for this one area. I know the user is active on the page so I'm looking for more of an Ajaxy keep alive solution. I'n guessing all I have to do is query the logged in member service to keep alive. I'll try this in a bit when I've fixed my current blocking issue :) 

  • Steve Morgan 1349 posts 4458 karma points c-trib
    May 20, 2015 @ 14:43
    Steve Morgan
    101

    To update this - setting the timeout (in v7.1.8) didn't seem to affect just the members, the only key that seemed to have any affect was:     

    <add key="umbracoTimeOutInMinutes" value="180" />

    I created an API call which I hit by AJAX (during each play / pause and at timed points during video playback) which just gets the current member and returns true / false (redirecting to the login page on false). 

    This does what I need - namely ensures that the user doesn't "play" a video after leaving the page open and then timing out and / or hitting the timeout whilst watchign a long video. Hope this helps someone else.

Please Sign in or register to post replies

Write your reply to:

Draft