counting visits with session_id
Posted: Sat Jun 28, 2003 2:32 pm
HI all,
I don't think I'm understanding session_id correctly. I have a php/mysql site that requires users to log in. I want to keep track of how many times each person logs in, but I also have given them the "always log me in from this computer" option. Most of our users will always be connecting from their same computer (they're all in the same building, assuming they log in from work), so it's likely they'll choose this option. If this is enabled, I have no way of controlling which page they enter the site at. So, I thought I could use session_id to tell whether or not this is a new log in or if they are accessing the site from another page within the site. I thought I would store session_id as a cookie on their computer (I can assume they'll have cookies enabled, because this should only be the issue if they've already chosen "always log me in from this computer"), compare it to the current session_id and, if different, increase the counter by one. I would then reset the cookie to the new session_id so that they could go anywhere in the site within that session without resetting the counter. I am trying to test this but session_id never seems to change. I've restarted my browser a number of times and the session_id is always the same. How can I track their log-ins and still allow the "always log me in from this computer" option?
I don't think I'm understanding session_id correctly. I have a php/mysql site that requires users to log in. I want to keep track of how many times each person logs in, but I also have given them the "always log me in from this computer" option. Most of our users will always be connecting from their same computer (they're all in the same building, assuming they log in from work), so it's likely they'll choose this option. If this is enabled, I have no way of controlling which page they enter the site at. So, I thought I could use session_id to tell whether or not this is a new log in or if they are accessing the site from another page within the site. I thought I would store session_id as a cookie on their computer (I can assume they'll have cookies enabled, because this should only be the issue if they've already chosen "always log me in from this computer"), compare it to the current session_id and, if different, increase the counter by one. I would then reset the cookie to the new session_id so that they could go anywhere in the site within that session without resetting the counter. I am trying to test this but session_id never seems to change. I've restarted my browser a number of times and the session_id is always the same. How can I track their log-ins and still allow the "always log me in from this computer" option?