PDA

View Full Version : General vB Session Guidance


etones
05-13-2003, 10:35 AM
Hi all, looking for a little help with vB sessions.

Firstly, it seems to use its own session system, non PHP standard, just wondering how to use it.

If I have a script someaddon.php, how whould I go about using the vb sessions to see if users have been logged in etc?

Any tips or links, is it just a matter of using the inbuilt functions?

Help... the code is far too messey and scary to work out lol :)

Thanks to everyone who replies,
Taz

filburt1
05-13-2003, 10:41 AM
All you have to do is add:

require("./global.php");

...which loads everything that a vB page uses including sessions, $bbuserinfo, the database connection, functions.php, etc.

etones
05-13-2003, 11:03 AM
hmmm, im actually developing an image gallery script that can run either standalone or with vB.

Now, including a vB global.php could be very over the top, is there any other way, without the bloat?

Taz

filburt1
05-13-2003, 01:21 PM
I'm not sure but try including sessions.php. Hopefully that'll create a session, but also IIRC it needs a database connection which can be tedious to create with DB_Mysql_vb (or whatever it's called).

etones
05-14-2003, 02:45 PM
well, can you clarify something for me.

Does vb use sessions, cookies or both?

Ie. i know its not using pure sessions with session_start() however there is a sessions table in the db and it can be set to move sessions through the query string.

Alternatively, if it uses cookies, they can be accessed manually as long as you're in the same domain, how would I go about doing this?

Cheers
Taz

filburt1
05-14-2003, 02:47 PM
It uses sessions if a user has cookies off in his user CP or if the user is a guest.

Check out http://www.php.net/cookie for how to use cookies.

etones
05-14-2003, 03:17 PM
cheers filburt.

will look into reading the vbulletin cookies

Taz