Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 2 of 2 total
Thread User Authentication - How?
Mon, Sep 3 2012 1:46 AMPermanent Link

Richard

ENT Technologies

How would you go about authenticating a user against a MySQL database? A short code example would be nice.

Also, how would you log off a user after a period of inactivity?
Mon, Sep 3 2012 11:17 AMPermanent Link

Raul

Team Elevate Team Elevate

Auth would have to be done by the backend (server) code - for example PHP or whatever you choose to use.

Easiest way would be to authenticate user (EWB app calling a login function on back-end) and then back-end validates username/password and issues a session ID (guid for example ) and also set a sessions expiry timestamp (X minutes in the future).

The EWB would have to include the session ID with every request so back-end just checks the sessions and expiry transparently and you can also update the session timestamp on back-end every time you get a request.

EWB app also has to deal with the session expired response properly f you wish to retain EWB app state. If you also wish to clear the EWB screens on inactivity then timer in EWB app should do the same thing - reset countdown whenever there is activity and prompt login (clear screens) once countdown reaches 0.

Raul

>>Richard wrote:
>>How would you go about authenticating a user against a MySQL database? A short code example would be nice.
>>Also, how would you log off a user after a period of inactivity?
Image