Synchronized access of session to prevent multithreading errors