FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » General » PHP discussions » strange session problem
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
strange session problem [message #8258] Mon, 20 January 2003 09:19 Go to next message
tufan is currently offline  tufan   Turkey
Messages: 70
Registered: June 2002
Karma: 0
Member
the following code doesn't work on linux apache 1.3.27, php 4.2.3 with register_globals=off:

<?php
session_start();

if (!isset($_SESSION['count'])) {
    $_SESSION['count'] = 0;
} else {
    $_SESSION['count']++;
}
echo "Count: {$_SESSION['count']}";
?>


every time you reload the page, a new PHPSESSID seems to appear, and the count is always 0. If you pass the PHPSESSID in links, everything is ok. It seems there is something wrong with the cookies, but i cannot guess what (cookie settings were open in the all browsers we tried)

Strangeness is, the very same code works on another linux machine with same configuration (We even tried copying php.ini from the working machine to the one which doesn't work, but it didn't help).

any idea why it doesn't work?


http://sfx-images.mozilla.org/affiliates/Buttons/firefox2/firefox-spread-btn-1.png
Ynt: strange session problem [message #8260 is a reply to message #8258] Mon, 20 January 2003 11:33 Go to previous messageGo to next message
tufan is currently offline  tufan   Turkey
Messages: 70
Registered: June 2002
Karma: 0
Member
Hmm..

Problem solved, it's caused by the locale of the operating system (tr_TR). I think, this problem is specific to Turkish.

If I'm not wrong, protoss already submitted this but to php.net. It's something with the variables including "I" letter. It seems to be not corrected yet. Similar problems occur with the apache itself. Variable names are changed.

So, if there is anyone using Turkish tr_TR locale on their system, change it to en_US, and then re-compile apache (if you compiled using tr_TR locale, there should be no need for recompiling if you've done an rpm installion, in this case, just change the locale to en_US, and restart the apache server).

c ya all..


http://sfx-images.mozilla.org/affiliates/Buttons/firefox2/firefox-spread-btn-1.png
Re: Ynt: strange session problem [message #8264 is a reply to message #8260] Mon, 20 January 2003 14:59 Go to previous message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
If you want to avoid these kinds of problems, upgrade your PHP to version 4.3.0

FUDforum Core Developer
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Help! mail() isn't working...
Next Topic: Does anyone have Traditional Chinese translation?
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Thu Nov 21 18:30:40 GMT 2024

Total time taken to generate the page: 0.03973 seconds