I am making an IM chat client and need to use one randomly generated session ID for 3 classes but can’t get it to work. When I try to pass it from one to the other it just makes a new one. The idea is that classA runs the chat and creates a new folder named after the sessionID, and saves the chatLog there. classB opens the folder (which is why it needs to know the sessionID) and runs methods on the data within the folder. Any help is appreciated.
Share
Make the sessionID a class of it’s own.
In constructor of class A
then when you go to call class B, add it in the constructor
for B
then use session as your session id.
Edit:
I cannot make it any clearer then that.. sorry if you still don’t understand it.