Quick question re: MyBB's cookies.
Pirata Nervo Offline
Member
***
Posts: 235
Joined: Jan 2008
Post: #2
RE: Quick question re: MyBB's cookies.
Interesting, by quickly looking at the sessions code it seems that in order to be seen as logged in, the entry must exist in the sessions table:

PHP Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
		// Attempt to find a session id in the cookies.
		if(isset($mybb->cookies['sid']))
		{
			$this->sid = $db->escape_string($mybb->cookies['sid']);
			// Load the session
			$query = $db->simple_select("sessions", "*", "sid='{$this->sid}' AND ip='".$db->escape_string($this->ipaddress)."'", array('limit' => 1));
			$session = $db->fetch_array($query);
			if($session['sid'])
			{
				$this->sid = $session['sid'];
				$this->uid = $session['uid'];
			}
			else
			{
				$this->sid = 0;
				$this->uid = 0;
				$this->logins = 1;
				$this->failedlogin = 0;
			}
		}


If a session is not found, it won't see you as logged in.

Do both of your forums use the same sessions table?

02-14-2011 08:20 AM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

Messages In This Thread
RE: Quick question re: MyBB's cookies. - Pirata Nervo - 02-14-2011 08:20 AM

 Standard Tools
Forum Jump: