L - 2013-08-12

I hava a java standalone program that manipulate and send mail via notes. It detect User at program start by:

DNotesFactory factory = DNotesFactory.getInstance();    
DSession session = factory.getSession();
String user = session.getCanonicalUserName();

If user id is changed by switching location in lotus notes client. How can I detect it in the java program. I tried polling the getCanonicalUserName as above, but it always return the userID which was selected when program start, not the current one.