PDA

View Full Version : Understanding vb3 Sessions


DigitalCrowd
02-11-2004, 05:30 PM
I am building a site that Vb3 is just one part of the big puzzle. Through reading threads on this site and other places, I have managed to create my system where registration happens outside vbulletin, and creates accounts in vbulletin, posts can be made to vbulletin outside of it. Vb3 is the primary user account system though, and I base everything off of it for my primary user base, but don't use it directly.

I designed it so that I can grow w/ vb3 modifications, but at the same time I am not dependent upon it for everything, so for example, I don't use Vb3 global files in all my scripts, cause it's not needed except when required by a script directly interfacing with Vb3.

ISSUE:

My system works great for users who login and use cookies, whether inside or outside the vb software. My question is... how does Vb3 use session handling for users w/o bbuserid and bbpassword cookies stored. I'd like to be able to peak at this session information when they are on other areas of the site to add that information to my $_SESSION array for the rest of my site's systems. I'd also like for people to be able to login outside of VB3 and I'd like to be able to create the necessary session information for VB3 to finish up this seamless experience.

Any hints or ideas would be helpful.

DigitalCrowd
02-11-2004, 05:53 PM
I might actually figure this one out myself... if you login and don't choose "remember" me, then it does create a session cookie called "sessionhash" which I assume is related to the session table... so there probably is a fucntion for that somewhere that I can decode and complete what I need to.

Anyhow, if anyone has any pointers, I am still open... but progress is being made.

DigitalCrowd
02-11-2004, 06:07 PM
<?

include("global.php");

// below variables passed on by login script
$bbuserid="";
$bbpassword="";

// build vbsession w/ remember me!
fetch_sessionhash();
build_session($bbuserid, $bbpassword);

?>

Okay, for those who might do this down the road... passing the bbuserid and bbpassword to this script will create the session setting for vbulletin3 to read. Now I just have to look at the individual functions to reverse engineer it so that I can read those sessions with my scripts to "keep the session alive" for the rest of my site.

bradsears
02-23-2004, 05:59 PM
I am interested in this as well. I'd like to keep the session alive as well for people with cookies disabled.

I have a bunch of forms on my site and I would like to pass the sessionhash around with the forms but I don't fully understand how vb3 uses the session hash.

shazzy
02-24-2004, 12:40 PM
In the past I have used...

setcookie("bbuserid","-1", time()-(3600 *24*7*365),"/","domain.com");
setcookie("bbpassword","-1", time()-(3600 *24*7*365),"/","domain.com");

In VB3 this dosent work, do I just change it to:

setcookie("bbuserid","-1", time()-(3600 *24*7*365),"/","domain.com");
setcookie("bbpassword","-1", time()-(3600 *24*7*365),"/","domain.com",LICENCENO);