The TIWApplication class represents a user session at the IntraWeb level, without the custom user extensions of the UserSession object. It is also used to manage the UserSession object if implemented.

The TIWApplication class is automatically managed by IntraWeb and an instance exists for each user session. It can be accessed as an argument to some events in the ServerController, and in most other places as a threadvar named WebApplication. The declaration exists in the IWApplication unit, so to access it IWApplication must exist in your uses clause.

Example

procedure TFormEdit.IWAppFormCreate(Sender: TObject);
begin
  lablURL.Caption := WebApplication.ReferringURL;
end;