title: confusion in running small history GWT application
body: <p>When I am running a small login application consisting of history management, it works fine at my home where im using latest chrome and firefox versions and GWT 2.4</p>
  
  <p>The same application when I run at my office works wild. I have used a Global static boolean variable which has correct value in the debug mode while it has wrong value when I run it normally. In Office Im using IE 7 and GWT 2.2</p>
  
  <p>Also, onModuleLoad() is called only once at my home environment whereas it is called everytime when I type someURL#sometoken and press enter to change the internal page. When is onModuleLoad() called. Only once per session or evrytime user loads some page (or even token)?</p>
  
  <p>Can anyone tell is this some problem due to IE 7 or GWT 2.2 or some other issue.</p>
  
  <p><strong>EDIT</strong> - Its very small app. Code ---</p>
  
  <h2>TestHistory.java</h2>
  
  <pre><code>public class TestHistory implements EntryPoint, ValueChangeHandler&lt;String&gt; {
  
      static boolean isLoggedIn = false;
      static final String PAGENAME = "mainscreen";
      public void onModuleLoad()
      {
          History.addValueChangeHandler(this);
  
          String startToken = History.getToken();
          System.out.println("onModuleLoad Called..... start token= -------"+startToken+"--------");
          if(startToken.isEmpty())
              History.newItem("login");
          else
              History.fireCurrentHistoryState(); //to execute onValueChange 1st time since 1st time history is not setup
      }
  
      @Override
      public void onValueChange(ValueChangeEvent&lt;String&gt; event) {
  
          String token = event.getValue();
          System.out.println("onValueChange called with token = ***"+token+"***");
  
          String args = "";
          int question = token.indexOf("?");
          if (question != -1) {
          args = token.substring(question + 1);
          token = token.substring(0, question);
          }
  
          if(!isLoggedIn)
          {
              if(token.isEmpty() || "login".equals(token))    //1st time opened the site normally
                  new Login().display(false, RootPanel.get());
              else {
                  new Login().display(true, RootPanel.get());
              }
          }
          else    //User has logged in
          {
              if(token.isEmpty() || "login".equals(token))
              {
                  if(isLoggedIn)
                      Window.alert("Ur already logged in!!!");
                  else
                      new Login().display(false, RootPanel.get());
              }
              else if("withdraw".equals(token))
                  new Withdraw().display(RootPanel.get(), args);
              else if("deposit".equals(token))
                  new Deposit().display(RootPanel.get(), args);
              else //token not clear
                  Window.alert("Unrecognized token=" + token);
          }           
      }
  }
  </code></pre>
  
  <h2>Login.java</h2>
  
  <pre><code>public class Login {
      static final String PAGENAME = "login";
      void display(final boolean hasTypedSomeToken,final Panel myPanel) //Process login
      {
          System.out.println("login display called");
          Label displayLabel = new Label("This is the Login Page");
          Label enterName = new Label("Enter ur name");
          final TextBox txtName = new TextBox();
          Label enterPasswd = new Label("Enter ur Passwd");
          final TextBox txtPasswd = new TextBox();
          Button btnLogIn = new Button("Login", new ClickHandler() {
  
              @Override
              public void onClick(ClickEvent event) {
  
                  /* Real app will check DB. Here we r jst chckng d txt fields hv value */
                  if(txtName.getValue().length()&gt;0 &amp;&amp; txtPasswd.getValue().length()&gt;0)
                  {
                      TestHistory.isLoggedIn = true;
                      if(hasTypedSomeToken) {
                          System.out.println("adsljasdlfjljkfsd");
                          History.fireCurrentHistoryState();
                          System.out.println("hoolala  "+History.getToken());
                      }
                      else
                      {
                          myPanel.clear();
                          Label displayLabel = new Label("Thank U for logging. U can now access the application.");
                          myPanel.add(displayLabel);
                      }
                  }   
              }
          });         
          myPanel.clear();
          myPanel.add(displayLabel);
          myPanel.add(enterName);
          myPanel.add(txtName);
          myPanel.add(enterPasswd);
          myPanel.add(txtPasswd);
          myPanel.add(btnLogIn);
      }
  }
  </code></pre>
  
  <h2>Deposit.java</h2>
  
  <pre><code>public class Deposit {
      static final String PAGENAME = "deposit";
      void display(Panel myPanel, String param)
      {
          System.out.println("deposit display called");
          myPanel.clear();
          Label displayLabel = new Label("This is the Deposit Page &amp; ur parameter = "+param+")");
          myPanel.add(displayLabel);
      }   
  }
  </code></pre>
  
  <hr>
  
  <p>Class Withdraw is same as Deposit.
  The problem Im facing is that once Im logged in I should be able to open all the internal pages which works perfectly at my home (and onModuleLoad() is called just once) whereas I have to log in everytime to open a internal page at my office (and onModuleLoad() is called evrytime)</p>