![]() |
Reading cookies from global.php
Hi All,
I've written a bit of a script that records some visitor information (what the referrer was the very first time they visited plus a visitor id that allows me to track them around the site). This information is stored in cookies. The cookies are fine, and I can read them from my own scripts as follows: $visitorid = $HTTP_COOKIE_VARS["visitorid"]; $origrefer = $HTTP_COOKIE_VARS["referer"]; I also know that the above works for scripts located in the forum directory. However, I have written some stuff in to global.php that I want to read these cookies. Whilst my script can detect the cookies with if (!isset($_COOKIE['referer'])), the above does not read from them. Does anyone know why the above does not work in global.php? Regards Ben. PS - Apologies for the spelling of referer - too late to change! |
anybody?
|
For security reasons, vBulletin global.php unsets all global variables except a few specified in array $_allowedvars.
As $HTTP_SERVER_VARS is not specified there it will be unset, therefore you should use $_COOKIE. |
Strange... I had tried that once with no luck but now it works a treat! Thanks for your help!
B. |
All times are GMT. The time now is 08:58 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|