WebSession

From Xojo Documentation

Class (inherits from WebObject)


New in 2010r4

This is the base class for the Session class that is included in all web projects. Each user session gets its own instance of WebSession that you can access using the Session method.

fa-info-circle-32.png
To refer to the current Session from within the Session object, use Self instead of Session as the prefix, especially in the Open event because it may return Nil.
Events
AllowUnsupportedBrowser JavaScriptError ScaleFactorChanged
Close Open TimedOut
ConnectionTypeChanged OrientationChanged UnhandledException
HashTagChanged PrepareSession


Properties
ActiveConnectionCount fa-lock-32.png HeaderCount fa-lock-32.png ScaleFactor fa-lock-32.png
Browser fa-lock-32.png Identifier fa-lock-32.png Secure fa-lock-32.png
BrowserVersion fa-lock-32.png LanguageCode StatusMessage
ClientTime LanguageRightToLeft Timeout
ConfirmMessage PageCount fa-lock-32.png Title
CurrentPage Platform fa-lock-32.png URL fa-lock-32.png
GMTOffset fa-lock-32.png RemoteAddress fa-lock-32.png
HashTag RenderingEngine fa-lock-32.png


Methods
Cookies.Count HeaderName ShowURL
Cookies.NameAtIndex PageAtIndex URLParameter
Cookies.Remove PageWithID URLParameterCount
Cookies.Set PageWithName URLParameterExists
Cookies.Value Quit URLParameterName
Header RawHeaders


Shared Methods
Available

Localizable Strings

These are Localizable Strings for localizing the built-in pages of a web app.

Constant Location Default Value
ErrorDialogCancel Exception Dialog Do Not Send
ErrorDialogMessage Exception Dialog This application has encountered an error and cannot continue.
ErrorDialogQuestion Exception Dialog Please describe what you were doing right before the error occurred:
ErrorDialogSubmit Exception Dialog Send
ErrorThankYou Exception Thank You Page Thank You
ErrorThankYouMessage Exception Thank You Page Your feedback helps us make improvements.
NoJavascriptMessage Initial Page Javascript must be enabled to access this page.
NoJavascriptInstructions Initial Page To turn Javascript on, please refer to your browser settings window.

Enumerations

These are the enumerations you must use with the Browser, Platform, and RenderingEngine properties.

BrowserType PlatformType EngineType
Unknown Unknown Unknown
Safari Macintosh WebKit
Chrome Windows Gecko
Firefox Linux Trident
Internet Explorer Wii Presto
Opera PS3 EdgeHTML (2015r3)
ChromeOS iPhone
SafariMobile iPodTouch
Android Blackberry
Blackberry WebOS
OperaMini iPad
Epiphany AndroidTablet
AndroidPhone

Notes

Use the Session object to access the current user session.

To refer to the current Session from within the Session object, use Self instead of Session as the prefix, especially in the Open event because it may return Nil.

fa-info-circle-32.png
Safari and Chrome (starting with v56) put background tabs into a "sleep" mode that cause Xojo web apps to display the "Application Disconnected" message if you leave a web app open in a background tab. To reconnect to the web app, refresh the tab.

Browser UI

By default, the user’s browser title displays the title of the current page. As pages are switched, the title will update accordingly. However, the developer can override the title on a session level by changing the Title property. This property overrides any page titles.

Databases

If your application is going to connect to a database server, you will want to store the database connection in a property of the Session class. This will allow your application to make connections to the server on a user-by-user basis.

Query Parameters

To access the query parameters, use the URLParameter methods to retrieve the query parameters from the Session object.

See Also

Session, WebSessionContext