Create some arbitary communication with the server when the user "navigates the page". For example when they click a "tab" despite it not needing from the server use AJAX to ping the server anyway.
Of course in reality you will want to check the session is live anyway after all the user could stare at the "Update" button from an hour before actually pressing it.
You need both else you'll annoy users who have been busily using your app then find they're somehow timed-out anyway which will be contrary to their experiences on other sites.
In ASP you would store something in the Session
object to indicate that the user is logged on. Here is an example "Am I logged on" page:-
<%
Response.ContentType = "application/json"
If Session("LoggedOn") Then
Response.Write "{loggedOn: true}"
Else
Response.Write "{loggedOn: false}"
End If
%>
Now you can use this page as your ping target. Ping just before update. If logged off I would suggest that you post details for update to the server any where but not to action the update. Request user loggon in your usual way with a redirect to a page that will then action those details.