Log in

View Full Version : Setting and Retrieving Cookies


y4hdesigns
11-12-2001, 08:48 PM
This may not be the place for this question, but...

We're looking into creating a single registration and logon system for vBulletin and the rest of our site.

To do so, we'd like to understand more about how the PHP is used to generate and call the cookie for logon.

Can someone help? Maybe just pointing to the right file would help so we can dig into it.

Our thought was to create a cookie with logon info for the rest of the site and for vBulletin and use that to log users on. We haven't decided whether to populate directly into the mySQL db for registration or to replicate from our other db at this point.

Any suggestions/comments would be helpful.

Thanks.

KD

Scott MacVicar
11-12-2001, 09:00 PM
I've found it easier to simply integrate the site with vbulletin instead of integrating vbulletin with the site, much easier :)

PHP automatically parses cookies for the domain and feeds them into variables and an array in the form
$HTTP_COOKIE_VARS[name] and $name

To learn about setting cookies
http://uk.php.net/manual/en/function.setcookie.php

y4hdesigns
11-12-2001, 09:06 PM
Thanks. I am tending to lean towards your thinking as well for the integration.

Can you tell me which vBulletin file is the main file for handling the cookies? Ie: which one sets the cookie and which one actually calls it?

Thanks.

Admin
11-13-2001, 11:03 AM
Sessions.php handles all the user cookies.
Member.php does the logging in and out of a user.
There are some more cookies plant by other files (forumdisplay.php for instance), but those are minor.

Cookies aren't called, like PPN said they are always available by using $HTTP_COOKIE_VARS['NameOfCookie'].

BTW, vBulletin has this nice function called vbsetcookie() for easier use. :)

y4hdesigns, please show you are a licensed user by going to this (http://www.vbulletin.com/members/vbulletin.org.php) page. Thanks. :)

y4hdesigns
11-13-2001, 01:49 PM
Thanks, that's a big help!

Sorry about the license thing...it's taken care of now.

KD