Restrict user session to one per login
Posted: 2019-11-29 23:57
Is there a way to log out a user if this same account has logged in somewhere else?
A place where AppGini users can exchange ideas and help each other.
https://forums.appgini.com:443/phpbb/
https://forums.appgini.com:443/phpbb/viewtopic.php?f=2&t=3340
Code: Select all
if ( $ip_db1 == '' ){
$ip_db1 = $ip_self
}else{
if ( $ip_db2 == ''){
$ip_db2 = $ip_self
}
}
if ( $ip_self == $ip_db1 or $ip_self == $ip_db2){
// success
}else{
you can only be logged in 2 devices at a time.
Refresh connection
( you will have to wait 5 minutes for access ) // setlock = 1 // when lock = 1 show timer then setlock = '' after 5 min
}
// log out button
if ( $ip_self == $ip_db1 ){
$ip_db1 = ''
}
if ( $ip_self == $ip_db2 ){
$ip_db2 = ''
}
log out function