Re: Get Logged In Users values from sql table
I use an intermediary page between the Login and the Main menu in nearly every application. Most apps have a handful of such session variables. My biggest app has about 40 to start and may establish and hold additional items as the user progresses.
Lee's right that sessions do expire and that can cause a problem.
For those apps that require the equivalent of no session expiration, the main menu page (for simplicity's sake here) has some javascript on a timer that fires every 5 minutes. That javascript requests a 1 byte, 1px x 1px image from the server, effectively renewing the session every 5 minutes as long as the browser is open. Works very nicely, doesn't create a load problem.
However, with the advent and growth of mobile/disconnected applications, more and more we're storing them not as session variables but as elements in the e object or for the lesser-used variables in localstorage (because it's slower).
Richard - sorry to see you're having some problems. Here's a very simple sample snippet that may help:
I use an intermediary page between the Login and the Main menu in nearly every application. Most apps have a handful of such session variables. My biggest app has about 40 to start and may establish and hold additional items as the user progresses.
Lee's right that sessions do expire and that can cause a problem.
For those apps that require the equivalent of no session expiration, the main menu page (for simplicity's sake here) has some javascript on a timer that fires every 5 minutes. That javascript requests a 1 byte, 1px x 1px image from the server, effectively renewing the session every 5 minutes as long as the browser is open. Works very nicely, doesn't create a load problem.
However, with the advent and growth of mobile/disconnected applications, more and more we're storing them not as session variables but as elements in the e object or for the lesser-used variables in localstorage (because it's slower).
Richard - sorry to see you're having some problems. Here's a very simple sample snippet that may help:
Code:
. . . sql = "select ID, Firstname, Lastname from USERS where somefilterhere" cn.execute(sql, args) rs = cn.resultset session.Firstname = rs.data("Firstname") session.Lastname = rs.data("Lastname") . . .
Comment