View Full Version : Vbulletin Cookies ?
Ok am trying to check if user is logged into the forums, from outside the forum directory.
Short of the 'traditional chdir/include global.php' route, is there another route I can take?
How about checking for cookies set by vB?
$_COOKIE['bbuserid'] perhaps and if so how do I read it?
any help ? :D
monotreme
11-23-2005, 07:34 PM
I have my vb set up as a subdirectory. program files in the same domain can get the vb cookies in this setup. assuming that you don't have them set to something odd. In vb I have them just covering the whole domain and the cookie path is the default /
If the user has a persistent login, then the bbuserid and bbpassword cookies exist and my outside script can get them.
a simple print_r($_COOKIE) will confirm this for you. I don't understand your questin
"how do I read it?" What you said: $_COOKIE['bbuserid'] -- that is how you access it, if it exists.
If the user is logged into vb but not a "rememberme" there are no external login cookies available.
So I'm supposeing that vbulletin is maintianing session only login in it's database. To get that your script would have to open a connection to the vb db and read the session table.
Paul M
11-23-2005, 09:10 PM
it depends on how you have your cookie domain set in vb - if you have it tied down to the forum folder level then you cannot read that cookie out of the forum. If you have it at domain level then you should be okay. Also, it's only bbuserid if your cookie prefix is set to 'bb'. :)
monotreme
11-28-2005, 06:20 PM
vb does set cookies for nonpersistent login, just not bbuserid and bbpassword (yes bb is default prefix.... configurable of course)
ConKien
12-28-2005, 05:17 AM
vb does set cookies for nonpersistent login, just not bbuserid and bbpassword (yes bb is default prefix.... configurable of course)
can you tell me what are they. I tried to view my account cookies but could not find bbuserid or bbpassword as you said.
Thanks,
CK
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.