reinstate code for saving session details and generating nonce + timestamp