EDIT: Found the issue... seems there wasn't enough space in the database field.
To monitor active users on my website, I've created a session class which uses cookies to store session data as it gives more flexibility than the default PHP session handler. To prevent session hijacking (and changing of cookie data), I've recently added a simple condition which checks the current browser and IP address against the value stored in the database.
if ($_SERVER['REMOTE_ADDR'] == $this->session['session_ip_address'] && $_SERVER['HTTP_USER_AGENT'] == $this->session['session_browser_agent'])
{
// Code if true
}
else
{
// Code if false
}
Unfortunately, Internet Explorer 8 does not seem to like the addition and I have no idea why since this is server side scripting. For some reason, a new session is created (new cookie and new data inserted into the database) on every click. I'd expect this if cookies were disabled, but they aren't. Everything works fine in Google Chrome and Mozilla Firefox, and it was working fine in Internet Explorer before I added this code. I've discovered that the issue only occurs when I validate the browser agent (IP is fine, and Internet Explorer 8 is receiving the session cookie), but when I compared the values of the created sessions I found out they are the same:
Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center
Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center
I'm not sure how, but it seems this can be fixed in some way since it is working fine in other browsers. I'd rather not just validate the IP address because validating them both adds a bit of extra security.
Any help will be greatly appreciated. :)