Who's Online Session Stats
<p>I have a MySQL table called "sessions", that contains a session_id, user_id, ip_address, and last_updated field.</p>

<p>I have the following questions:</p>

<ol>
<li><p>What's the best way of updating the "sessions" table if the user has not visited the site before, or if the user navigates to a different page?</p></li>
<li><p>If a users navigates to a page that requires them to be logged in, what's the best way of remembering the page that they were viewing, prior to them being redirected to the login page, so that they can be returned to it after logging in?</p></li>
<li><p>How do I calculate the total number of members/guests currently online, and the total members/guests for the day, even if users of the same computer use different web browsers?</p></li>
<li><p>I want to display how many users/guests are viewing a certain page. What's the best way of keeping track on what page the user is currently on.</p></li>
</ol>

<p>Any help is greatly appreciated. I've been scratching my head about the above for some time!!! ;)</p>
