The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Need help with sessions not being recorded on non-VB pages (3.5.1)
I kinda doubt that this issue is common, but I'm hoping someone out there will be able to offer some advice. My problem deals with sessions, and probably requires a solid familiarity with vbulletin 3.5.x code.
I have a website that is partially integrated with my forums. The forums are located at "/forums"; the main site and all of its pages are located at "/". I want users to be signed in all over the entire site, so I have this code in the header of all pages outside of the forums. PHP Code:
This has worked just fine for months, on vBulletin 3.5 RCx to 3.5 Gold. I upgraded to 3.5.1 over the weekend, and it still works perfectly .... except for one thing: sessions. For some reason, now sessions are not being updated in the forums session table when a site visitor (guest OR member) visits a page outside of the forums. Before the upgrade, the session table was updated whenever a visitor accessed any page with global.php included in it. For example, the session table locations would look something like: /index.php /forums/index.php /forums/poll.php /contests.php /index.php /forums/showthread.php?t=34983 /tourn.php /contests.php ....etc I upgrade from 3.5 Gold to 3.5.1, and now my sessions table looks something like: /forums/index.php /forums/poll.php /forums/showthread.php?t=34983 /forums/index.php /forums/poll.php /forums/showthread.php?t=34983 ...etc. Pages located outside of the forums should be showing up in the session table... because they are being visited. But, no. It appears that the session update is being bypassed, but after comparing the changes in class_core, init, global, functions, functions_online, and a couple of other vb pages, I can't figure it out. Out of the few changes that were made in those pages, nothing that would be dependant on the root path of the script has changed, that I saw. I even backtracked the code from the UPDATE to `session` (I think that's in save(), in class_core.php). After spending hours comparing the updated forum pages to the previous version and making sure my options and plugins are all working, I'm close to giving up. Can anyone offer any advice? Neither my cookie domain, nor path (nor any other HTTP/cookie settings) changed with the upgrade, but could it still be a cookie thing, or have something do with lastactivity in the cookie? Much thanks ... |
#2
|
|||
|
|||
Nevermind, I found it, finally. Of course, it was a tiny little thing, and to be honest I don't know if it was added to 3.5.1 for security reasons... or... er... hope it's not super important.
init.php, line 202: PHP Code:
I removed PHP_VERSION < '5' OR , and sessions are once again being recognized (rather, it now gets as far as the database session handling). Sweet. |
#3
|
|||
|
|||
So what did you put in your header for it to record sessions? Im interested also because i want to put conditionals but the page doesnt reconize the user isnt logged in, even tho its in the header.. so it doesnt work. Any help? thanks
|
#4
|
|||
|
|||
This is the entirety of the VB integration, placed at the very top in the header of my non-forums pages (which are all located in the root folder of my site). This inclusion, along with the little 3.5.1 hack I mentioned above, will properly update the 'session' table whenever someone visits a page outside of the forums:
PHP Code:
Oh and I don't define THIS_SCRIPT there, because I don't use any of vBulletin's templating or WOL... or anything else except the $vbulletin data. So.. your mileage may vary. |
#5
|
|||
|
|||
Well im my site, im using this for a comment system. I put it above the form box and used else statement. But even if the user is logged in or not, it still shows the else.
I havethe header in an include. So its on a different page. Could this be why i am having this problem? Tested out the code you sent me and it the same for logged in and logged out... Ill try puting the include in the news page also... although ive tried that before |
#6
|
|||
|
|||
Quote:
Here are a few things you could check. I am assuming your forum installation is located at http://www.yourdomain.com/forums, and you are running vBulletin 3.5.x). 1. Make sure in your vBulletin options, your cookie path is "/", and cookie domain is ".yourdomain.com" (notice the initial period -- this is crucial if you have any subdomains, but doesn't hurt otherwise). 2. Let's say your header is "header.php". It might look something like this: PHP Code:
PHP Code:
|
#7
|
|||
|
|||
k cool, ill try that out
Nope... when i changed the cookie domain to my site, it woudltn let me log out on any page. My forum domain is /forum/ ... when I made the else say Not logged in and it says it again for logged in and out If you have aim, my aim is balla1088 is you want to help. |
#8
|
|||
|
|||
/forum/ is not a domain but a directoryname.
|
#9
|
|||
|
|||
I no that, im just stating that. I just used the suggested one, + that is what he told me to use. the .sitename.com
|
#10
|
|||
|
|||
To add to this, the condition in the header, for the login, work fine. I have if and else for guest and members...
EDIT: Well i narrowed this down to the only reason this is because of the script im using... im trying to find a way around this. I am using a news script, and its all one page, with alot of mysql calls, and i think the includes on this page is screwing up the forum login sessions... Any help? Yay, found a way around, i had to call out information from the cookie stored by $_COOKIE['bbuserid'] then to get username i just called out the information by basic db connection instead of the include of it. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|