title: Guardian - "Remember Me" using refresh token
body: <p>I'm trying to implement the advice given by @hassox in the following GitHub issue:</p>
  
  <p><a href="https://github.com/ueberauth/guardian/issues/142" rel="nofollow">https://github.com/ueberauth/guardian/issues/142</a></p>
  
  <p>After the user logs in, I'm generating a token and storing it in a cookie that has a ttl:</p>
  
  <pre><code>claims = Guardian.Claims.app_claims
  |&gt; Guardian.Claims.ttl({30, :days})
  
  {:ok, token, full_claims } = Guardian.encode_and_sign(user, :remember, claims)
  
  thirty_days = 86400 * 30
  
  conn = put_resp_cookie(conn, "remember_me", token, max_age: thirty_days )
  </code></pre>
  
  <p>In addition, I have a Plug (to put underneath <code>Guardian.Plug.LoadResource</code>) in my <code>:browser_auth</code> pipeline:</p>
  
  <pre><code>pipeline :browser_auth do
    plug Guardian.Plug.VerifySession
    plug Guardian.Plug.LoadResource
    plug Zoinks.Plug.RememberMe
  end
  </code></pre>
  
  <p>Here's what the Plug looks like at the moment:</p>
  
  <pre><code>defmodule Zoinks.Plug.RememberMe do
    import Plug.Conn
    import Guardian.Plug
  
    def init(opts \\ %{}), do: Enum.into(opts, %{})
  
    def call(conn, opts) do
      current_user = current_resource(conn)
  
      if ( current_user == nil ) do
        jwt = conn.req_cookies["remember_me"]
  
        case Guardian.decode_and_verify(jwt) do
          { :ok, claims } -&gt;
            if ( claims |&gt; Map.get("typ") == "remember" ) do
              {:ok, remember_user } = load_resource( conn, claims, opts )
  
              # This doesn't seem to do what I want
              conn |&gt; Guardian.Plug.sign_in( remember_user )
            end
  
          { :error, reason } -&gt;
            # Do something
        end
      end
    end
  end
  </code></pre>
  
  <p>How do I create a new token, store that in the session and continue on to the desired page, instead of being re-routed to the sign-in page?</p>