PDA

View Full Version : how do sessions work in vb3 beta 7?


bradsears
10-13-2003, 11:31 PM
Hi. I'm building an application that uses a bunch of vbulletin functions and tables.

In vb 2.~ I was fine with:

require_once("global.php");
session_start();

Now that I have ported over to vb3b7 I notice that my sessions are gone between pages. I don't understand what they are doing with sessions now, I assume it is for security.

What I want to be able to do is put a variable into a session and be able to access that session on another page.

Does anybody have any ideas as to what I need to understand about vb3b7 and sessions?

Thanks

SmEdD
10-14-2003, 02:01 AM
Check out global.php and session.php.

Thats all I can give you as vB3 code disscussion is still not allowed.

bradsears
10-14-2003, 02:12 AM
ok. I can abide by that. I don't fully understand sessions.php yet but I'm getting there.

Thanks

DrkFusion
10-14-2003, 02:43 AM
I believe vB does not use session hashes (db) to manage active sessions for logged in users, but only for guests, I think vb uses cookies for users now.

bradsears
10-14-2003, 12:50 PM
I think that sessions.php clears the sessions after it runs so I think I'm going to convert all my sessions to variables in there before the clear. I would have preferred to not have to add any code to sessions.php but I guess just this once...

Dean C
10-14-2003, 12:56 PM
vB does work using sessions as well as cookies Arunan. Why do you think there is the sessionhash in the url still :)

SmEdD
10-14-2003, 03:14 PM
Why do you need to know how they work? Like what exactly are you trying to do?

bradsears
10-14-2003, 03:35 PM
I use the vbulletin back end to help me with user management (and forum of course) on a web application I am building.

- I collect some user data with form1.php
- I post to the form1.php and validate the post variables
- after successful validation set them all to session variables and and redirect to form2.php (visual verification for the user) and so on through my 5 page process.
- my session variables are not present in form2.php like they were in vbulletin 2.3
- it looks like the sesison gets cleared in sessions.php
- since sessions.php is called from global.php then my problem is that I need the vbulletin back end but I need my sessions as well

The two ideas I have through of are:
1) forget this multi page process and put all the stuff on one multi stage page and just use post variables for everything, skipping sessions completely
2) convert all my session variables to variables in sessions.php before the session clear

I appreciate your time. Thanks

SmEdD
10-14-2003, 08:09 PM
Well get the code out of global.php and you should be fine!

And I also noticed 3 out of 4 of use that have posted in this thread are from Canada ;)

bradsears
10-14-2003, 08:18 PM
I'll do something with it. Too bad my limited understanding seems to say that vbulletin takes my session and won't give it back. I'm sure they have a good reason.

Thanks for your help my Canadian brothers - and word to Mist ... Canada is cool with the UK.