I'm writing an RMI application which uses swings on the client side. The user has to first login with his email and password. After his login a new JFrame is opened and based upon his email id from first ui, I should fetch data from database in the second ui.
I am new to this thing and I want to know how I can maintain sessions so that username is propagated to all JFrames. I read an article about using system properties as shown to store username:
System.setProperty("application.userName", myUserName);
I want to know whether using system properties to store email is good practice or can i maintain session in a more better way?