# Dead-man Timer

**URL:** <https://forum.elixirforum.com/t/dead-man-timer/24422>\
**Category:** Questions\
**Tags:** phoenix, redirect, render, genserver\
**Created:** [August 3, 2019, 2:22pm UTC](https://forum.elixirforum.com/t/dead-man-timer/24422 "2019-08-03T14:22:36Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![peerreynders](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/peerreynders/32/5826_2.png) [@peerreynders](https://forum.elixirforum.com/u/peerreynders)\
**Post date:** [August 3, 2019, 3:08pm UTC](https://forum.elixirforum.com/t/dead-man-timer/24422/2 "2019-08-03T15:08:38Z")

</div>

> [@bodhilogic](#):
>
> A bonus would be for the redirect to happen _ **only** _ if the user has not interacted with the page since the timer started

If the user doesn’t interact with the page then there is no HTTP request.

- No HTTP request - no redirect.

So unless you are using LiveView there isn’t anything you can do. The timer would have to be based on the client-side (i.e. the browser) and make a request when there is no activity.

With LiveView you would simply change what is currently rendered on the page after the timeout expires - but there is no [redirect](https://hexdocs.pm/phoenix/Phoenix.Controller.html#redirect/2) involved.

EDIT: I forgot about [channels](https://hexdocs.pm/phoenix/Phoenix.Channel.html) - i.e. you might be able to use them to have the server send a message (at timeout) to the browser and have some browser-based code take some action.

---

_[View the full topic](https://forum.elixirforum.com/t/dead-man-timer/24422)._
