title: Protecting against XSRF attacks GWTP app
body: <p>I am trying for <a href="http://code.google.com/p/gwt-platform/wiki/GettingStartedDispatch" rel="nofollow">protecting against XSRF attacks</a> GWTP app. The problem facing like JSESSION easliy get in <a href="http://www.testingsecurity.com/paros_proxy" rel="nofollow">paroz testing tool</a>, using that tools if user is already logged in and at the same time made same server request by paroz. it execute same transaction with updated value, which is a security problem. </p>
  
  <p>To stop that one, <strong>Required to create per request new cookie</strong> and send from client to server.</p>
  
  <pre><code>@SecurityCookie
  public static final String securityCookieName = getRandomString(); //Not work
  </code></pre>
  
  <p>For ClientModule </p>
  
  <pre><code>public class ClientModule extends AbstractPresenterModule {
  
      @Override
      protected void configure() {
  
          bindConstant().annotatedWith(SecurityCookie.class).to(
                  NameTokens.securityCookieName);
  </code></pre>
  
  <p>And in DispatchServletModule</p>
  
  <pre><code>public class DispatchServletModule extends ServletModule {
  
      @Override
      public void configureServlets() {
          bindConstant().annotatedWith(SecurityCookie.class).to(NameTokens.securityCookieName);
  </code></pre>
  
  <p>I want to generate cookie randomally instead of 'JSESSIONID'. How/where to do? And what is a proper way to regenerate cookie per request in GWTP?</p>