php.net |  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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: cstrebin at softdevel dot com
New email:
PHP Version: OS:

 

 [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');
session_start();
$x = & $HTTP_SESSION_VARS['x'];
if (!isset($x)) $x = 1;
$x *= '1.1';
print("$x<br>\n");
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.

Patches

Pull Requests

History

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

--Jani
 [2001-02-20 07:30 UTC] sniper@php.net
No feedback, considered fixed.

--Jani
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed May 07 22:01:27 2025 UTC