dops57958 2013-08-12 07:02 采纳率: 0%
浏览 41

PHP Cookie集和引用在include()环境下不起作用

Basically, I'm hitting my head against the wall trying to figure out why a cookie I set refuses to work properly on my dashboard throughout the application. Here are different locations and levels of elevation in which the cookie's info can be retrieved.

Domain.com/login.php (Location Where Cookie is Defined)

setcookie('GoogleIDCookie',$googleID,time()+3600,'/');

../Domain.com/index.php?page=GoogleVoice

--> Loads ---> (Through include();)

../Domain.com/dashboardContent.php?page=GoogleVoice

--> Loads ---> (Through include();)

../Domain.com/DashboardContent/googlevoice-content.php

At the index.php?GoogleVoice level (Where I need it to work -- and where all other included scripts and variables are working, besides this one) I get the following output for trying to set a new variable to the Cookie Variable

$googleID = ($_COOKIE["GoogleIDCookie"]);
Notice: Undefined index: GoogleIDCookie

However, when I go directly to the php page not used in the include, it works as expected. ../DashboardContent/googlevoice-content.php

At first I thought it was the level of the cookie, but I specified for it to work throughout the domain and appears only to not work when include(); is involved.

Any thoughts?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 vscode的问题提问
    • ¥50 切换TabTip键盘的输入法
    • ¥15 可否在不同线程中调用封装数据库操作的类
    • ¥15 微带串馈天线阵列每个阵元宽度计算
    • ¥15 keil的map文件中Image component sizes各项意思
    • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
    • ¥15 划分vlan后,链路不通了?
    • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
    • ¥15 Vue3 大型图片数据拖动排序
    • ¥15 Centos / PETGEM