#Assuming you have set the LOGINNAME session var somewhere, $loginname = $Session->{LOGINNAME};