|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #7626 session saving and loading seem to use different locales
Submitted: 2000-11-03 12:19 UTC Modified: 2001-02-20 07:30 UTC
From: cstrebin at softdevel dot com Assigned:
Status: Closed Package: Session related
PHP Version: 4.0.0 OS: Linux 2.2.14
Private report: No CVE-ID: None
 [2000-11-03 12:19 UTC] cstrebin at softdevel dot com
My LANG environment variable is "german". At the beginning of every page, I do `setLocale('LC_ALL', 'en_US')'. With those settings, float session variables are saved with `,' as decimal point, but loading seems to expect `.' so that I get values truncated to ints.

Example script:
setLocale('LC_ALL', 'en_US');
$x = & $HTTP_SESSION_VARS['x'];
if (!isset($x)) $x = 1;
$x *= '1.1';
printf("<a href=\"%s\">go</a>\n", $HTTP_SERVER_VARS['PHP_SELF']);
// (link relies on transparent sid)

The session file contains `x|d:1,1;', and the page always shows `1.1', since the loaded value becomes 1.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2000-11-05 06:14 UTC]
Serializer uses locale-sensitive sprintf for doubles, which it probably should not. 
 [2000-12-15 20:18 UTC]
Please try the latest snapshot from

 [2001-02-20 07:30 UTC]
No feedback, considered fixed.

PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Tue Mar 21 05:03:38 2023 UTC