session id logic fixed