Forum Moderators: coopster

Message Too Old, No Replies

PHP session created on each page reload

Apache2/PHP5/WinXP

         

le_gber

8:09 pm on Jul 18, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi guys,

I have a problem whereby each time I reload a page a new php session is created in my temp folder.

Needless to say that sessions are not passed from one page to another.

CAN ANYONE HELP?!?!?!?

I've been searching for the past two days - bugs on php.net and php.net page on session seem to give info but it is not working for me.

scriptmasterdel

8:14 pm on Jul 18, 2006 (gmt 0)

10+ Year Member



Can you post some code as an example so the devs can point out the problems?

In my opinion ...

As long as you have : session_start(); on the top of each page and assign session variables below this then there should be no problems with passing session data.

Del

le_gber

8:54 pm on Jul 18, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



hi scriptmasterdel,

I think it's more a PHP bug or a php.ini issue.

I developped the site on apache2triad and it's working fine on it. I have now changed PC and installed Apache / PHP and MySQL separately but it ain't working.

le_gber

7:52 am on Jul 20, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



OK I now found that restarting apache doesn't kill the session either, anyone has an idea of why?

I am thinking windows folder persmissions, but don't know what to aad/change them to :(

Cheers

le_gber

8:06 am on Jul 20, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



[ RESOLVED ]

it was ZONE ALARM :(

Will ahev to play with configuring it now

Cheers

[ / RESOLVED ]

coopster

10:49 pm on Jul 20, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



I'm curious as to how you were managing the session -- via cookies? If so, and you are letting ZA whack them all you will need to adjust the
Privacy > Main tab > Cookie Control
settings.

le_gber

10:45 am on Jul 21, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi coopster - it seems to be a pb with ZA. As soon as you have cookie control set to medium and ad control (??) set to medium as well, it messes up the local sessions (I used php $_SESSION)

I tried adding the two domains (localhost and 127.0.0.1) to my list of trusted sites and disabling cokies and ad control in there only (for them in the trusted site list) but it didn't work either.

I also tried having only the ad control on (privacy general settings) but it still didn't work.

More reading here:
-http://forum.zonelabs.org/zonelabs/board/message?board.id=Privacy&message.id=3049

Basically you have three solutions:

  • toggle ZA on / off - not an option if you are conected to the internet
  • toggle both ad and cookie control (in the privacy general settings) on / off - not a suitable option for me as I often develop and go find answer on the internet when I'm stuck (which happen more often than I'd like to admit)
  • use another program to test you dev project and set the privacy control for this program to off (in program control)

    I used the last one with IE (I browse using FF). Allowed it to only access the trusted zone and turned off privacy (I am not using it for anything else anyway)

  • coopster

    12:27 pm on Jul 21, 2006 (gmt 0)

    WebmasterWorld Administrator 10+ Year Member



    Medium level cookie control will:
    1. Block third-party cookies
      • Blocks cookies from third-party Web sites

    2. Remove private header information
      • Prevents your IP address, your workstation name, login name, or other personal information from being transferred to third-party sources.

    By default, Cookie control is disabled so you must have cranked it up. Personally, I control this in my browser, not in ZA. Even so, all that aside, why would it be blocking anyway, are you managing sessions through a third-party site?

    le_gber

    12:53 pm on Jul 21, 2006 (gmt 0)

    WebmasterWorld Senior Member 10+ Year Member



    I understand about the cookie settings but even if I added the site to my list of 'trusted' sites and unticked all the cookie / ads control it still didn't work.

    If I turn off cookie control and leave ad control on to medium it still doessn't work - as soon as I turn on a single setting from the ad control the whole thing goes pear shape.

    Nope not using third party site to control sessions - but when running sessions locally just doesn't work if you have ZA and cookie control and/or ad control turned on.