Vote #74553
未完了A popup message after session timeout
0%
説明
When the session timeout is set and a user leaves an unsaved form for a while so their session expires and clicks on the Save button, they is redirected to the login page and all unsaved data from the form just being edited are lost.
The same frustrating situation can happend when you write a long wiki page.
The flash message on the login page does't help to recover lost data.
I thing that the user should be warn before data are lost.
Please take into account the attached simple patch that add a Javascript popup message with the warning text about session expiration.
journals
I guess that the patch won't work if redmine is installed with a sub-URI.
Also, won't the heartbeat request reactivate the session?
--------------------------------------------------------------------------------
> I guess that the patch won't work if redmine is installed with a sub-URI.
I've removed the slash in route.rb:
<pre><code class="ruby">
-get '/session_heartbeat', :to => 'application#session_heartbeat'
+get 'session_heartbeat', :to => 'application#session_heartbeat'
</code></pre>
> Also, won't the heartbeat request reactivate the session?
I don't think so. I skip the reactivation in session_expiration method:
<pre><code class="ruby">
def session_expiration
+ # Skip session heartbeat
+ return if ((params[:controller] == 'application') && (params[:action] = 'session_heartbeat'))
</code></pre>
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
related_issues
relates,New,10569,Save user data on invalid form authenticity token