Jump to content

[SOLVED] Need help with $_COOKIES


ScotDiddle

Recommended Posts

Hi Folks, I inherited a production php 5.1.6 LAMP environment at my new job here in Richmond VA.

 

The Linux Guru set me up a dev environment...

 

phpinfo() looks the same for both systems...

 

Here's my problem:

 

When I start debugging PRODUCTION with Zend Studio 5.5.0, the $GLOBALS show a cookie called

 

    $_COOKIE['SessionID'] with a value of mv5nfdru8jrdl98de8j0ssest0

 

When I start debugging DEV (which contains an exact copy of PROD source code) $_COOKIE is not set at all in GLOBALS.

 

This is affecting subsequent login logic between the two systems.

 

Can someone explain where PROD is getting his $_COOKIE name and value and why DEV does not have the same variable ?

 

These values are either there, or not there, as soon as I hit PF8 and start a Zend Studio debugging session.

 

(Eventually ( like right away...) both the PROD and Dev code issues :  session_name( 'SessionID' ); followed by: session_start();

 

But, the $_COOKIE value is only set on PROD...)

 

Any ideas / directions / advice ... etc. will be appreciated.

 

Thanks in advance.

 

Scot L. Diddle, Richmond VA

Link to comment
Share on other sites

The session is not being started, probably due to a header error or an include statement that is not working or short open tags being used...

 

Are you developing and debugging php code on a system with error_reporting set to E_ALL and display_errors set to ON in your php.ini to get php to display all the errors it detects so that it would be helping you? Stop and start your web server to get any change made to php.ini to take effect and confirm that the settings where actually changed using a phpinfo() statement in case the php.ini that you changed is not the one that php is using.

Link to comment
Share on other sites

PFMaBiSmAd,

 

    Thanks for the input... My problem turned out to be :

 

        " ini_set('session.cookie_domain', '.someDomainName.com'); "

 

    My test server is called " linux2.someDomainName.com" and I thought it was a sub-domain.

 

    Turns out it isn't and I had to use:

 

        " ini_set('session.cookie_domain', 'linux2.someDomainName.com'); "

 

Scot L. Diddle, Richmond VA

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.