title: Domino Document cannot be opened twice on public access xpage
body: <p>I have an Xpage with access set to public for clients to fill in a form. When I send the client the link to the page and they open it for the first time. Everything runs smoothly. However, if they close the browser and click on the link again they receive this error: </p>
  
  <p>{Unexpected runtime error</p>
  
  <p>The runtime has encountered an unexpected error.</p>
  
  <p>Error source</p>
  
  <p>Page Name:/xpClientForm.xsp</p>
  
  <p>Exception</p>
  
  <p>Could not open the document</p>
  
  <p>Invalid universal id}</p>
  
  <p>I am using a switch facet to cycle between forms depending on the client type. 
  The domino document id is being stored in a <strong>sessionScope beforepageload</strong> and the document dynamically computes it based on that sessionScope variable.</p>
  
  <p>Here is the code: </p>
  
  <blockquote>
    <p><strong>SessionScope assignment on beforepageload</strong></p>
  </blockquote>
  
  <pre><code>var cData = getClientData(id);
  sessionScope.docId = cData.docID;
  </code></pre>
  
  <blockquote>
    <p><strong>Document datasource</strong></p>
  </blockquote>
  
  <pre><code>&lt;xp:panel style="height:100px" id="pnlDocData"&gt;
                      &lt;xp:this.data&gt;
                          &lt;xp:dominoDocument var="document1"
                              formName="frmA" action="editDocument"
                              documentId="#{javascript:sessionScope.docID;}" scope="request"&gt;
                      &lt;/xp:this.data&gt;
  &lt;/xp:panel&gt;
  </code></pre>
  
  <p>However when i execute this custom control on a page that does not have public access. It runs fine with no issues irrespective of how many times i open the link.</p>
  
  <p>Any help will be greatly appreciated.</p>