Made the following changes:
1) Eliminated the get request for the log every time the page is loaded as it made no sense to get that info back every time.
2) Added a log.php page that lets me see the contents of the session variables at any given time
3) Fixed the issue of saving session. I haven't tested much, but it seems I am able to store session information that allows user to resume her sessions even after a window close