You cannot handle browsers back button or refresh button 100%. There are multiple ways and scenario that can trigger either of them.
Instead, your design/implementation should be such that it is not affected by such interferences.
Here, in case of timer, refresh would reset it if the timer is on client side. You need to put some logic to track time on server side and validate it. Handle refresh occurance if it happens. Further, put a red message and display it to user that 'DO NOT REFRESH' or you will loose something ;)
Just for validation purpose:
Refresh Page Issue in ASP.Net[
^]
Stop Refresh after Submitting your Request[
^]
Detecting Page Refresh[
^]