If you would like to restrict single user name/Id to get multiple session in axapta, try below
select count(recid) from clientSession where clientSession.userId==curuserid() &&
clientSession.status!=0 &&
clientSession.sessionType==0;
if(clientSession.recid>1)
{
for(myloop=1,myloop<=150,myloop++);
{
progress.incCount();
progress.setCaption("Alert")
progress.setText(strfmt(" '%1' is already logged-in",curuserid()));
sleep(5);
}
infolog.shutDown(true);
}