User agent with HTML forms

Doug Easterbrook doug at artsman.com
Thu Jan 28 18:05:56 UTC 2021


hi Thad

we’ve been tracking the user agent for years in our remote tasks and storing it in the database.

they are embedded in the first parameter (a ROW variable) for the remote task.

when I looked at our code, we got it out of HTTP_USER_AGENT …. eg

If isclear(tWebParameters.HTTP_USER_AGENT)


are you able to debug your remote task to see what is in the parameters … maybe omnis changes it from the apache standard to be the above?



now, for complete disclosure, we used our own copy of the omnis interface module that we custom compiled for apache 2 way back in studio 5.x era.    I imagine things are the same


we converted to nginx about 7 years ago for a number of reasons, so I can’t tell you if things are changed.


I checked apache documentation and it seems to still refer to http_user_agent….



Doug Easterbrook
Arts Management Systems Ltd.
mailto:doug at artsman.com
http://www.artsman.com
Phone (403) 650-1978

> On January 28, 2021, at 8:50 AM, Thad Bogert <thad at technosolver.com> wrote:
> 
> Hi All,
> 
> Kelly was able to point me to the the documentation for including HTTP headers in the $construct() parameters of a remote task.  Thanks Kelly!
> 
> For posterity:
> 
> -------------------------------------------------
> Cookie and Referer Headers
> 
> When a request arrives at the web server from an HTML form, there are some HTTP headers sent from the client that may be of interest to the remote task instance. These include “Cookie:” and “Referer”. (Note that a discussion of how the various HTTP headers work is beyond the scope of this document; there are many good sources of information on the Web). You can gain access to these parameters using the following mechanism.
> 
> In your HTML form, include an empty parameter with the name HTTP_<header name>, for example, HTTP_COOKIE. This is an instruction to the Omnis web server plug-in, telling it to insert the value of the corresponding HTTP header into the form parameter. This means that when $construct() runs, there is a column HTTP_<header name> in the row variable parameter, and its value is the value of the HTTP header. Note that the header value can be empty if it is either not present, or not available to the Omnis web server plug-in.
> ————————————————————————
> 
> Unfortunately this feature only seems to work with non-hyphenated header names. For example HTTP_Referer works but HTTP_User-Agent does not when using the Apache module.  I will be sure to report the limitation to Omnis so that it can be addressed. 
> 
> 
> Thad
> 
>> On Jan 27, 2021, at 5:29 PM, Thad Bogert <thad at technosolver.com> wrote:
>> 
>> Hi All,
>> 
>> Does anyone know if there is a way to pass the user agent info of the client browser to a remote form that is submitting from a static HTML form?
>> 
>> I have been able to create a workaround by populating a hidden form field with the navigator.userAgent property, but I am hoping for a solution where the info comes from the http header.
>> 
>> 
>> Thanks,
>> 
>> Thad
> 
> _____________________________________________________________
> Manage your list subscriptions at http://lists.omnis-dev.com
> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com 



More information about the omnisdev-en mailing list