View Full Version : Set session outside vB
Kaitlyn2004
09-26-2007, 11:44 AM
I have a whole bunch of systems which integrate with vB but they still require you to log in separately.
Is there a way to set minimum session data to "log in" to vB? I know there is tons in the session array but can i set just a few to have them be logged in?
Dismounted
09-26-2007, 11:47 AM
$password = md5(md5($password) . $salt);
setcookie(COOKIE_PREFIX . 'userid', $userid, time() + 14400);
setcookie(COOKIE_PREFIX . 'password', md5($password . $license), time() + 14400);
Kaitlyn2004
09-26-2007, 12:33 PM
$password = md5(md5($password) . $salt);
setcookie(COOKIE_PREFIX . 'userid', $userid, time() + 14400);
setcookie(COOKIE_PREFIX . 'password', md5($password . $license), time() + 14400);
What about just for the session?
ianskate
09-26-2007, 08:01 PM
yeah that doesnt tell you anything about setting the session. im doing the same thing currently, and just setting the cookies for userid and pw doesnt do much, vBulletin still thinks you arent logged in.
you need a bbsessionhash cookie which matches the session hash found in a row created in the _session table. unfortunately, vb has a very complex way of creating the id hash/sessionid. ive been searching the forums literally all day and pleanty of people talk about it, but no one shows how its actually done. so im resorting to digging through the source in order to find it. so far ive at least found away to create the idhash in the session table. Im having problems figuring out all the variables used in the sessionhash itself.
Dudsmack
09-27-2007, 12:44 AM
ive at least found away to create the idhash in the session table.
How do you generate the idhash?
The session hash is read from the cookie bbsessionhash - I know that's not how it's made but I hope that helps.
reebosak
01-09-2008, 06:58 PM
How do you generate the idhash?
$idhash = md5( $_SERVER['HTTP_USER_AGENT'] . $subnet );
where $subnet is the class C network of the remote IP that vbulletin sees.
for example:
My IP : 192.168.1.111
$subnet will be 192.168.1
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.