PDA

View Full Version : Sessions & Block Cookie setting truncates vBulletin Code?


donjames
08-21-2002, 03:49 PM
Hi,

I am working on integrating vBulleting with our website, and want to pass session info to it if someone visits vBulletin from other pages on our site.

So, in the phpheader template, I added a "session_start()" command to pass session info from page to page.

It seems to work fine IF THE USER ALLOWS COOKIES. However, if the user's browser is set to block cookies, though most of it displays correctly (with links that will pass the session id), various parts of the display do not.

For example: on the forum home page, immediately after the "lock" image on the bottom, the text "<font face="verdan" appears and then the rest of the display ends (so no contact or home page links appear after this). In other words - for some reason, with the "session_start()" command in the php_header, if the user's browser is set to block cookies, the display gets truncated when the <small font> is being parsed after the lock image (<small font> works fine before this point).

ANYONE HAVE ANY IDEAS WHAT MIGHT BE CAUSING THIS?

To see what I mean, you can go to the forum at http://66.220.24.247/forum/ - try viewing it with your browser set to allowing cookies, and the set it to blocking cookies and refresh the screen.

IF ANYONE HAS ANY THOUGHTS ON WHY THIS HAPPENS, I WOULD GREATLY APPRECIATE IT. ;)

Has anyone else tried using sessions between their site and their forum?

NTLDR
08-21-2002, 04:10 PM
It works fine for me, both with cookies enabled and cookies blocked with IE6 and NT 5.1.

If you wish to use the vB sessionhash on your none forums pages add this to the top of the PHP file:

require('./forums/golbal.php');

And then use s=$session[sessionhash] instead of PHPSESSID in your links.

Hope this helps.

donjames
08-22-2002, 01:09 AM
NTLDR, I think that's because I was working on trying something different. I've since switched it back to using sessions - and I get the same thing. Can you see if it still works for you or if you now get what I was talking about?

Thanks.

donjames
08-22-2002, 01:44 AM
QUESTION,

the vB sessionhash - is that a real session or a way to mimic a session? Is it an array of variables kept in memory or is it just a variable used to track people online (stored in the session table).

I'm trying to understand why there would be any conflict when I use "session_start()". There doesn't seem to be any conflict when the user doesn't block cookies - but if he does, the entire page does not get displayed - which gives some weird behavior (sometimes, clicking on a link will display the rest of the html that should have been displayed on the previous page - but didn't.

It's almost like there isn't quite enough memory to output the entire html document (if cookies are blocked) and it gets temporarily stored somewhere until you click on another link.

Example - with cookies blocked (I'm using IE6.0), go to the home page (http://66.220.24.247/forum/ ). At the bottom, you might see "<font face="verdana,arial,he " or it might give part of the text that follows the locked icon. Then click on the FAQ button up top. When I do that, the FAQ page comes up and the last few questions are cut off. Now, if I click on the Home Button - it takes me back to the home page, but above the actual Home Page html, it shows the remaining questions - with some extraneous html since the html tags were cut off.

Now - if I don't block cookies, none of this happens - everything works great!

Has anyone run into this kind of a problem. The code that affects this is definitely "session_start()" because I've taken it out and it works fine even when cookies are blocked.

Thanks :D