The ServerController is a singleton class. Only one instance of a ServerController will exist in any IntraWeb application.
The ServerController is used to provide configuration information about your application, as well as provide a place for central configuration events.
In code the singleton instance is available by adding ServerController to the uses clause, and then referring to the global IWServerController function.
Indicates if your application supports multiple user sessions within the same browser window.
Contains the application name.Used when you install your SA Server application as a Service.
Informs IntraWeb if the User Authorization will be requested before a user session is created. If you do not uses any custom authorization that depends on any property/method you have declared on your User Session class, leave this property as False.
Use this property to assign one of the built-in Authorization components from IntraWeb. The Authorization components uses the default browser login/password dialog.
Use this property to specify a IP the SA Server application will be bound to. Specially useful when you run your SA Server in a computer with several network adapters.
Contains the full path to the folder used as the IntraWeb general cache.
Informs IntraWeb to call automatically COM initialization routines and the COM model to apply.
Use this property to inform IntraWeb to use compression and also which compression level. IntraWeb compression uses IW zlib (based on zlib Cloudflare).
- AllowDeflate: Boolean
- AllowGZip: Boolean
- Enabled: Boolean
- Level: Integer
- MinSize: Integer
- PreCompress: Boolean
- CookieNameSuffix: String
- HttpOnly: Boolean
- SameSite: (ssoLax, ssoNone, ssoStrict)
- Secure: Boolean
- SessionCookies: Boolean
- UseCookies: Boolean
Informs IntraWeb the name of your Custom GIF file. The custom GIF file need stay in wwwroot folder.
Contains the application Description. Used when you install your SA Server application as a Service.
Contains the Display name for the application. Used when you install your SA Server application as a Service.
Use this property to indicate IntraWeb a DocType to be used when rendering your pages.
(smAlert, smNewWindow, smSameWindow, smSameWindowFrame);
Use this property to inform IntraWeb how to show an Application Exception to the user.
Use this property to control the behavior of the TIWExceptionLogger class instance.
- Enabled: Boolean
- FileName: String
- FilePath: String
- LogType: (ltEventLog, ltFile)
- PurgeAfterDays: Integer
- ReportInfos: (riAppInfo, riExceptionInfo, riIWAppInfo, riStackTrace, riRequestInfo)
Use this property to add custom tags to the headers of your IntraWeb forms. When you add some content to this property, all IntraWeb forms will include it when rendered.
HTML Language Code Reference.
Use this property to control the Windows Kernel mode driver. Http.sys IntraWeb applications are also stand alone.
- AddDefaultBind: Boolean
- HostWildCard: (hwStrong, hwWeak)
- VirtualHostName: String
Use this property to control the Embedded JQuery.
- AjaxErroMode: (emAlert, emConsole, emNone)
- Debug: Boolean
- EnableFirebug: Boolean
- jQueryVersion: String
- RenderjQuery: Boolean
- UseUncompressedFiles: Boolean
This property is only used in IntraWeb 17. This property can be used to replace the default Loader HTML. The value of this property will be ignored if an external loader exists. Read more…
Use this property to inform how IntraWeb saves its Log information (used internally by IntraWeb in some parts of the code). When you enable this property, IntraWeb generates the log file in the same folder as your application.
Use this property to specify a name of your master template file for your application. The master template file need stay in template folder.
- ViewportTag: String
Port: Integer = 0
For standalone and http.sys projects, Port specifies the TCP port to listen on. A value of zero specifies that a random free port should be used and can be useful during initial development and debugging.
PostRedirectGet: (prgDisabled, prgEnabled)
Use this property to Redirect to an HTTPS port. ISAPI inclusive. Requires: ServerController.SSLOptions.NonSSLRequest = nsRedirect;
When TRUE, IntraWeb will restart an expired session when it detects that the browser is requesting an expired or invalid session. In fact, the session is not exactly restarted, but a new session is created (with a different Session ID). When possible, the original start parameters will be used in this new version, meaning that the new session will start just like the old expired session.
- ContentHandler: String
- RedirectToContentHandler: Boolean
SecurityOptions contains sub properties described here.
Use this property to indicate the amount of time (in minutes) a user session can remain idle (ie, no user activity in the browser) at the server side. Read only for Personal and Standard editions with the default value of 20 minutes.
SSLOptions contains sub properties described here.
Use this event to make any pos-processment after the your application dispatches a client request. You need to include the units IW.Http.Request (THttpRequest) and IW.Http.Reply (THttpReply) in your uses clause.
procedure TIWServerController.IWServerControllerBaseAfterDispatch(Request: THttpRequest; aReply: THttpReply);
if (aReply.Code ry<> 404) then begin
Log(‘User agent: ‘ + Request.UserAgent);
Log(‘Content Type: ‘ + aReply.ContentType);
Use this event to modify the IntraWeb reply before it is sent to the client or any other processment needed by your application. You need to include the units IW.Http.Request (THttpRequest) and IW.Http.Reply (THttpReply) in your uses clause.
procedure TIWServerController.IWServerControllerBaseBeforeDispatch(Request: THttpRequest; aReply: THttpReply);
if Pos(‘192.168’, Request.RemoteAddr) = 0 then begin
This event is triggered when a User Session is destroyed.
This event is truggered when an Exception occurs in your application.
This event is triggered after a user session is created and just before IntraWeb creates a session ID for the user session. Use this method if you need to create a custom session ID for each user session.
This event is triggered just after a new user session is created.
This event is triggered when the track ID of the application is out of sync.
This events triggered before IntraWeb renders the next form to be shown to the user. You can use this event to show another form to the user, instead of the form to be shown.
ASession: TIWApplication; AForm: TIWBaseForm; var VNewForm: TIWBaseForm);
if not UserSession.CheckFormSecurity(AForm.ClassName) then begin
VNewForm := TLoginForm.Create(WebApplication);
TLoginForm(VNewForm).FormToRequestAuth := AForm.ClassName;
AForm := Nil;
This event is triggered after a form is rendered.
This event is triggered when the IWP parser finds a user tag in a HTML page served by your application. For more information see User Tags.
This event is triggered when the IWP parser finds a session tag in a HTML page served by your application.
This event is triggered when a new user is connecting ro your application. Use this event to determine the application behavior in accordance to the browser the user is using.