I would like to be able to save text entered into a field as a cookie and then later, after closing and reopening the browser, be able to get that data from the cookie to have the field filled in already.
We need this to do a "remember me" checkbox on a login name field on our webclient solution.
Here is some test code I've been using.
runs on solution load to start the http client
- Code: Select all
function onload () {
plugins.http.createHttpClient('DexOnline')
}
onaction event for a button to create the cookie after text entered into test field
- Code: Select all
function savecookie () {
plugins.http.setHttpClientCookie( 'DexOnline', 'DexOnlineUID', UID, 'ourwebsite.com', '/', 10000000, false)
}
onaction event for a button to put cookie data in the show variable.
- Code: Select all
function testcookie () {
var cookie = plugins.http.getHttpClientCookie( 'DexOnline', 'DexOnlineUID')
show = cookie.getValue() + ' - ' + cookie.getComment() + ' - ' + cookie.getDomain() + ' - ' + cookie.getName() + ' - ' + cookie.getPath() + ' - ' + cookie.getSecure()
}
This all works great in a single session. Problem is that the cookie expires when the browser is closed. How can we make the cookie expire much later?
Thanks!