Hi Bruce,
In the LoginForm under the ValidateUpdate embed
if p_web.GetValue('loc:hash') = p_web.GetSessionValue('loc:hash')
! login checking goes here. In this example a simple 'Demo / Demo" login will work. Your app will
! probably need a stronger test than that.
CLEAR(CME:RECORD)
CME:UserName = CLIP(Loc:Login)
CME:Password = CLIP(Loc:Password)
IF NOT Access:cmes.Fetch(CME:k_User) THEN
p_web.ValidateLogin() ! this sets the session to "logged in"
p_web.SetSessionValue('loc:hash',0) ! clear the hash, so this login can't get "replayed".
! set the session level, and any other session variables based on the logged in user.
p_web.SetSessionLevel(1)
p_web.SetSessionValue('SYSID',clip(CME:cmerecnum))
p_web.SetSessionValue('Folder',clip(CME:InDataFolderName))
p_web.SetSessionValue('User',clip(CME:UserName))
p_web.SetSessionValue(PWD',clip(CME:Password))
p_web.SetSessionValue('Email',clip(CME:SendToEmail))
p_web.SetSessionValue('SecLevel',clip(CME:Level)) !Set Security Level
! this next bit shows how the login & password can be stored in the browser
! so that it is "remembered" for next time
if loc:remember = 1
p_web.SetCookie('loc__login',loc:login,today()+30) ! note the expiry date. It's good
p_web.SetCookie('loc__password',loc:password,today()+30) ! form to make sure your cookies expire sometime.
else
! don't remember, so clear cookies in browser.
p_web.DeleteCookie('loc__login')
p_web.DeleteCookie('loc__password')
End
Else
loc:invalid = 'Loc:Login'
p_web.SetValue('retry',p_web.site.LoginPage)
loc:Alert = 'Login Failed. Try Again.'
p_web.DeleteCookie('loc__login')
p_web.DeleteCookie('loc__password')
End
Else
p_web.DeleteCookie('loc__login')
p_web.DeleteCookie('loc__password')
End
I then have in the NetWebBrowse procedure under NetWebBrowse Settings/Security
"User must be logged in" checked
"Only Serve IF" this code p_web.GetSessionValue('SecLevel') = 5
But when I log in and then click on the browse menu to open it will not open, any suggestions?