Session Data

From: Chewy509 (Chewy509_at_austarnet.com.au)
Date: 03/10/04


Date: 9 Mar 2004 16:40:10 -0800

Hi All,

I'm having a small problem with sessions, or in particular some of the
data is not being saved within the session data.

To be exact, 1 variable from within an object is not being saved, but
all the other varibles within the same object are. Having a look at
the created session file, shows an unusual field relating to the
varible in question.

Session Data:
HRM_App|O:7:"hrm_app":9:{s:5:"state";a:0:{}s:7:"user_id";s:2:"19";
s:8:"username";s:17:"d.smith";s:4:"dept";s:1:"1";s:4:"comp";s:1:"2";
s:13:"user_security";i:1;s:3:"msg";s:0:"";s:15:"defaultRedirect";s:0:"";
s:3:"cfg";a:11:{s:6:"dbtype";s:5:"mysql";}}

The odd one out is: s:13:"user_security";i:1; where all the other
fields have the following format: s:3:"msg";s:0:"";

When I query that field later on, it returns "1", not the value that
it's initialised with as part of the application login procedure
(which also sets the other variables as well).

So can someone explain what the "i" indicates, what's going on, and a
possible fix?

TIA, Chewy509.

PS. PHP 4.3.2 on Win2K with IIS.
PPS. I've searched for a description of the session file format used
by PHP, but can't find one anywhere? If someone knows of a link, then
it would be appreciated to pass on that info.



Relevant Pages

  • Re: Help please with the dreaded what if question
    ... One of the worst things you can do is keep this in a session. ... session data is not necessarily cleared from the database ... Rather, post the potential sale to a pending transaction table, along with the ...
    (comp.lang.php)
  • Re: Help please with the dreaded what if question
    ... proficient in php. ... One of the worst things you can do is keep this in a session. ... not be written to the database immediately, causing you to sell the last item twice. ... session data is not necessarily cleared from the database ...
    (comp.lang.php)
  • Re: [PHP] Session cookie doesnt work
    ... regardless of the call to session_set_cookie_params. ... If you're looking to propagate a session across time, you should look at keeping your session data in a database, then calling a table row based on a cookie you set independently of the session. ...
    (php.general)
  • Re: how to unset session variable when leaving page
    ... there is a server side solution). ... based on session timeouts. ... Rather, I look at the incoming data to see how the page needing the session data was requested, and start from scratch if it's a new request, i.e. to a search page. ...
    (comp.lang.php)
  • Re: sessions and security
    ... authentication every time the user needs to get to sensitive data (or ... Session data is not stored in cookies or anywhere on the browser. ... hijacking) but it does not contain credit card numbers, ...
    (comp.lang.php)