473,408 Members | 2,477 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Session Data

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:"us er_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:"de faultRedirect";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.
Jul 17 '05 #1
3 1680
Ch******@austarnet.com.au (Chewy509) wrote in message news:<33**************************@posting.google. com>...
Session Data:
HRM_App|O:7:"hrm_app":9:{s:5:"state";a:0:{}s:7:"us er_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:"de faultRedirect";s:0:"";
s:3:"cfg";a:11:{s:6:"dbtype";s:5:"mysql";}}

So can someone explain what the "i" indicates,


IIRC, integer.

--
"I don't believe in the God who doesn't give me food, but shows me
heaven!"--Swami Vivekanandha
Email: rrjanbiah-at-Y!com
Jul 17 '05 #2
Chewy509 wrote:
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?


One thing that may help you determine what is happening is to do a
var_dump of the $_SESSION array. Then you can see in human terms what
each variable is. From what I see above, $_SESSION['user_security'] = int(1)

If you are expecting a string, make sure you have quotes around the
value when assigning it to the variable. Short of that, there really
isn't enough information for more help.

--
Justin Koivisto - sp**@koivi.com
PHP POSTERS: Please use comp.lang.php for PHP related questions,
alt.php* groups are not recommended.
SEO Competition League: http://seo.koivi.com/
Jul 17 '05 #3
Justin Koivisto wrote in message...
Chewy509 wrote:
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?


One thing that may help you determine what is happening is to do a
var_dump of the $_SESSION array. Then you can see in human terms what
each variable is. From what I see above, $_SESSION['user_security'] = int(1)

If you are expecting a string, make sure you have quotes around the
value when assigning it to the variable. Short of that, there really
isn't enough information for more help.


I found out what was causing it, a fault in one of the php scripts,
was assigning the variable a value, instead of comparing the value,
(the classic: "if ($user_security = 1) {" instead of "if
($user_security == 1) {" ).

I guess I should have looked harder at all the scripts that use this
variable?

Thanks again.
Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Damien | last post by:
Hi to all, I'm currently re-designing our intranet : nice and lean CSS2, cleaned-up PHP 4.3.7, better-normalized MySQL ;o). So I've started using the $_SESSION variable instead of register_globals...
9
by: bajopalabra | last post by:
hi session("myVar") = rs.getRows( ) don't work when number of records is greater than 10 does anybody know WHY ??? is it a Session object limitation ??? thanks
2
by: adam | last post by:
Having spent nearly 2 years in win forms land the inevitable request came for me to "do some web pages". So being new to this bit of .net and having had a look around I can't see where the best...
5
by: Abhilash.k.m | last post by:
This is regarding the session management using Out of proc session management(SQL SERVER). Among the samples below which one is better to set the session? 1. There are 20 session...
2
by: John Mullin | last post by:
We are having a problem which appears similar to a previous posting: http://groups.google.com/groups?hl=en&lr=&frame=right&th=d97f552e10f8c94c&seekm=OZw33z9EDHA.2312%40TK2MSFTNGP10.phx.gbl#link1 ...
5
by: Just D. | last post by:
Do we have any access to the Session object from a different Session? The idea is to save Session of a current user and then if he logs in again then return the Session back. It's not a problem to...
3
by: catweezle2010 | last post by:
Hello NG, I have three files (default.aspx, search.aspx and work.aspx). The way is: login on default (if session is newsession). The loginname I write into as sessionvariable (username). So I...
0
by: joseph conrad | last post by:
Hi, I tried to implement my own session handler in order to keep control on the process the drawback I foun it is not creating and storing in my cookie the PHPSESSID variable anymore. reading te...
43
by: davidkoree | last post by:
I mean not about cookie. Does it have something to do with operating system or browser plugin? I appreciate any help.
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.