Jump to content

Keeping track of guest users


smerny

Recommended Posts

I'd imagine they use a table listing the people viewing the forum, if they are logged in an online flag is marked, otherwise they are considered a guest, updated everytime they do something, if not actiuve in the last 10 minutes (example) they get deleted, stored by ip.

if you want to store it as a database id, you can create a table named GUEST with a schema like this:

id INT(5) NOT NULL autoincrement

SID VARCHAR(32) NOT NULL

 

and have a script in your header with something like this

<?php
//pseudo-code
session_start();
if (!$_SESSION['user']){
$guest_session = session_id();
//store it to the database. check for old sessions that have expired, etc.
}
else{
//they are a member
}

this is the ugly version. I figured I'd let you flesh it out.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.