|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #25630 session_decode feature
Submitted: 2003-09-22 12:52 UTC Modified: 2013-08-21 02:13 UTC
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: marrtins at hackers dot lv Assigned: yohgaki (profile)
Status: Closed Package: Session related
PHP Version: 4.3.3 OS:
Private report: No CVE-ID: None
 [2003-09-22 12:52 UTC] marrtins at hackers dot lv
need to store session decoded data in array not only in variables.



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-09-23 03:28 UTC]
Would you please explain this a bit better?
Like some example maybe..?

 [2003-09-23 03:45 UTC] marrtins at hackers dot lv
so i'll try to explain now :)
my homepage uses sessions(i wrote a session handler) to store users information - some username, visited sections, etc data

i wrote a script, to check who is online right now - scanning for sessions active in last 3 minutes. script reads those session data from mysql table. data looks like this:

$session_data="user|a:2:{s:8:"username";s:6:"foobar";s:9:"useremail";s:0:"";}<some other data>..."

sou, it will be usefull to have function to get all these variables in one array. for example

$session_vars = get_session_vars($session_data);

as a result will be
$session_vars['username'] = 'foobar';
$session_vars['useremail'] = '';
and so on.
 [2010-11-19 14:35 UTC] lealcy at gmail dot com
There is no need for a new function to do this, just change the prototype of 
session_decode function to

function session_decode($data, $overwrite_session = true);

then make the function returns an array with the session data always, this let to 
the programmer to choose overwrite the $_SESSION or just get the decoded array.
 [2011-01-01 02:00 UTC]
-Package: Feature/Change Request +Package: Session related
 [2012-03-31 04:34 UTC]
-Assigned To: +Assigned To: yohgaki
 [2012-03-31 04:34 UTC]
I think there is dup of this request.
 [2013-08-10 08:04 UTC]
Use php_serialize serialize handler, then you'll not have such issue.

php_serialize is available 5.6 or later.
 [2013-08-21 02:13 UTC]
-Status: Assigned +Status: Closed
 [2013-08-21 02:13 UTC]
php_serialize will be available from PHP 5.5.4.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun May 26 07:01:30 2024 UTC