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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
28 + 43 = ?
Subscribe to this entry?

 
 [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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 02:01:29 2024 UTC