title: Playframework's Secure module is not redirecting to the original url after login
body: <p><strong>Edited:</strong></p>
  
  <p><em>I am running Ubuntu 10.04 and this problem seems to occur on Chrome (7.0.517.44), however, everything works fine on Firefox.</em></p>
  
  <p><em>This is extremely strange. I have another application where the redirectToOriginalUrl works fine in 'dev' mode on both browsers, but does not work in 'prod' mode (again on both browsers). Wow, I don't have the faintest idea what is happening!</em></p>
  
  <p><strong>The Problem:</strong></p>
  
  <p>I am getting the strangest error with Playframework (version 1.1.1), where the redirectToOriginalURL is not working in the Secure module.</p>
  
  <p>I have 2 controllers Application.java and NameC.java</p>
  
  <p>The view Application/index.html displays a simple page with a link to an action in NameC.java (NameC.index())</p>
  
  <p>NameC.java is protected with the annotation @With(Secure.class)</p>
  
  <p>Here is the flow I am expecting. First the user goes to the application home page. There they click on the link which would take them to NameC.index. However, since NameC is protected with the Secure module, the user should be taken to the login form (since they are not yet logged in), and upon successful login, they should see the page rendered by NameC.index</p>
  
  <p>I get the login form, but upon successful login, the user is taken to Application.index I tried putting a print statement in Secure.redirectToOriginalURL() method, and it seems like the "url" does not exist in flash scope.</p>
  
  <p>Here is my code:</p>
  
  <p><strong>Application.java</strong></p>
  
  <pre><code>public class Application extends Controller {
      public static void index() {
          render();
      }
  }
  </code></pre>
  
  <p><strong>Application/index.html</strong></p>
  
  <pre><code>&lt;a href="@{NameC.index()}"&gt;Click here&lt;/a&gt;
  </code></pre>
  
  <p><strong>NameC.java</strong></p>
  
  <pre><code>@With(Secure.class)
  public class NameC extends Controller {
      public static void index() {
      render();
      }
  }
  </code></pre>
  
  <p><strong>NameC/index.html</strong></p>
  
  <pre><code>You should see this after a successful login.
  &lt;a href="@{Secure.logout()}"&gt;logout&lt;/a&gt;
  </code></pre>
  
  <p>I am sure I am missing something very basic... can anyone please help me figure out what I am missing.</p>