I tried a counter or Boolean but as long as it falls in the Document Completed event it will be reset each refresh
What you need to do then is check the value of it first before you increment it. So basically you would declare an Integer at class level (ie outside of an event handler or Sub/Function) and use this to keep track of which stage you are currently at. After you complete each stage you add 1 to the counter so that the next time the DocumentCompleted event is raised your code will know which bit to execute.

E.g:
vb Code:
  1. Public Clas Form1
  2.  
  3.   'Declare our counter at class level
  4.   Private Counter As Integer = 0
  5.  
  6.   Private Sub Document_Completed etc etc
  7.       If Counter = 0 Then
  8.           'Do sign in stuff here
  9.           'Add 1 to the Counter
  10.           Counter += 1
  11.       ElseIf Counter = 1 Then
  12.          'Do stuff here that you would do after sign in
  13.          Counter += 1
  14.       ElseIf Counter = 2 Then
  15.          'Do stuff here you would do the next time the page is reloaded
  16.          Counter += 1
  17.       End If
  18.   End Sub
  19.  
  20. End Class

Of course you need to make sure you reset the counter to 0 if you start this process again