Hi guys!
I Used to have a UX with controls for username and password and in the server side event like in a mobile security situation I would put the following code :
Ive started a new project and I created a login component for the web security system a la : https://puu.sh/wdcze.png
So It logs in fine. but I don't know where to put the code to set the logged in user to a session variable. I tried adding it to the on Login page in the UX inserted into the redirected page. But it stays blank.
The HTML page cant have server side events, and the login builder doesn't have anywhere to set server side events.
So my question. When using a Login Builder. How do you set the current logged in user to a session variable?
I Used to have a UX with controls for username and password and in the server side event like in a mobile security situation I would put the following code :
Code:
function onLogin as v (e as p) dim session.UserFirstName as c = "" dim session.UserLastName as c = "" dim session.UserUserName as c = "" if e.loginSucceeded = .T. then dim cn as sql::Connection dim args as sql::Arguments dim SQL as c ' SQL = "SELECT userid, Firstname, Lastname FROM websecurityusers WHERE UserName = :UserName" args.set("UserName",e.username) ' if cn.open("::name::ConnectionToExpenseRequests") ' if cn.Execute(SQL,args) ' if cn.ResultSet.nextRow() ' a record was found ' session.UserFirstName = cn.ResultSet.data("Firstname") 'session.UserLastName = cn.ResultSet.data("Lastname") session.UserUserName = e.username ' end if 'end if 'cn.close() end if if session.UserLastName <> "" e.userNameFriendly = alltrim(session.UserFirstname)+" "+session.UserLastname end if end function
So It logs in fine. but I don't know where to put the code to set the logged in user to a session variable. I tried adding it to the on Login page in the UX inserted into the redirected page. But it stays blank.
The HTML page cant have server side events, and the login builder doesn't have anywhere to set server side events.
So my question. When using a Login Builder. How do you set the current logged in user to a session variable?
Comment