NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: tglomb on March 22, 2014, 07:04:49 AM

Title: How to store "global" Config data
Post by: tglomb on March 22, 2014, 07:04:49 AM
I need to store some global values a user configured in a session so that the next time he uses the program it must not be done again. These values must be persistent for ever and some of these values I must read out at the very first possible point, before any website is openend, especially before the Login. This is like having an Ini file/registry setings for Win32 progs which I read out at mainframe procedure setup embed.

These values are workingplace/device related, because some of it I must use before the program knows which user has logged in.
So, how to Cookie it ? Which embeds I must use ? Any hints and ideas are appreciated.
TIA. Ciao Thomas
Title: Re: How to store "global" Config data
Post by: terryd on March 23, 2014, 12:45:41 AM
HI. How would you know who the user was before the login?
Title: Re: How to store "global" Config data
Post by: tglomb on March 23, 2014, 01:45:05 AM
I neeed to "remember" some config values on a per device basis which are equal for all users working at that device.
Ciao Thomas
Title: Re: How to store "global" Config data
Post by: peterH on March 23, 2014, 02:51:57 AM
Could you store by ip,  mac, computername or some other id depending on your setup and environment?

Peter
Title: Re: How to store "global" Config data
Post by: Robert Iliuta on March 23, 2014, 03:33:47 AM
>I neeed to "remember" some config values on a per device basis which are equal for all users working at that device.

you need to store computer name or mac address for this and then compare when login user.

/Robert
Title: Re: How to store "global" Config data
Post by: tglomb on March 23, 2014, 05:01:00 AM
Hi Peter and "I Robot" (sorry, couldnt resist..)
good idea to have a table in the dict which holds these globals. Thanks. The MAC address would be the unique identifier for a device.
But which is the very first embed at which I can read out the MAC and then get the record with the device globals BEFORE anything else happens ? That means directly after a user typed in the IP, hits [Enter] to start the Web program und the first request tooks place.
Dumb question: hase every Internet aware devive a MAC (i and Android Phones ect.) ?
I wished I could store a good ol' CFG file at the devices..
TIA, Thomas
Title: Re: How to store "global" Config data
Post by: peterH on March 23, 2014, 08:24:44 AM
>I wished I could store a good ol' CFG file at the devices..

Well, you can, sort of. But to do so you'll have to study how to use SQLite. That's a selfcontained db that can be used on all the devices you mention. And Clarion has support for that.
I have no personal experience but it should definitely be doable.

Peter
Title: Re: How to store "global" Config data
Post by: tglomb on March 23, 2014, 10:09:45 AM
Cool idea, thanks Peter
Title: Re: How to store "global" Config data
Post by: Bruce on March 23, 2014, 10:20:52 PM
You could set a cookie on the device, and then with every request sent from the device the cookie will come too.
see
http://www.capesoft.com/docs/NetTalk8/NetTalkWebBasic.htm#Cookies (http://www.capesoft.com/docs/NetTalk8/NetTalkWebBasic.htm#Cookies)