BBjThinClient::setUserProperty
Description
In BBj 11.00 and higher, this method stores a key/value pair in a specified client-sideproperty group.
Syntax
Return Value | Method |
---|---|
void | setUserProperty(long group, String attributes, String key, String value) |
void | setUserProperty(long group, String key, String value) |
void | setUserProperty(String key, String value) |
Parameters
Parameter | Description |
---|---|
group | |
attributes |
|
key |
Specifies the key to be saved on the client. |
value |
Specifies the value to be saved on the client. |
Return Value
None.
Remarks
In BUI and DWC, USER_PROPERTIES_COOKIES maps to browser cookies with a 30-day expiration, USER_PROPERTIES_STORAGE maps to browser local storage, and USER_PROPERTIES_SESSION maps to browser session storage. Any other group value is treated as a cookie with a specified expiration timestamp (e.g. System.currentTimeMillis()+24*60*60*1000*7 is exactly 7 days from now).
In GUI, the three groups map to nodes in a Preferences tree, which doesn't allow keys or values to include any $00$ characters.
If no group is specified, the default value is taken from STBL("!USER_PROPERTIES").
In BBj 20.00 and higher, the attributes parameter can be set to a SameSite value of "Lax", "None", or "Strict" to specify the set of domains that can read a given cookie. For more information, see Google's notes for Chrome 80+. If no attributes value is specified, the default value is taken from STBL("!SAME_SITE"). The SameSite value is only meaningful in BUI and DWC.
In BBj 23.06 and higher, the attributes parameter can be set to a string of arbitrary cookie attribute values (e.g. "secure; partitioned").
When a BUI or DWC application creates a browser cookie, the cookie path attribute defaults to window.location.pathname. Some applications might want more control over the path attribute. In BBj 22 and higher, STBL("!COOKIE_PATH") can be used to specify the path value for any cookies created with setUserProperties.
Example 1
|
Example 2
|
Example 3
|
See Also
BBjThinClient::getUserProperty
BBjThinClient::getUserProperties
BBjThinClient::setUserProperties
See the BBj Object Diagram for an illustration of the relationship between BBj Objects.