473,796 Members | 2,916 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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:"hr m_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_secu rity";i:1;s:3:" msg";s:0:"";s:1 5:"defaultRedir ect";s:0:"";
s:3:"cfg";a:11: {s:6:"dbtype";s :5:"mysql";}}

The odd one out is: s:13:"user_secu rity";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 1700
Ch******@austar net.com.au (Chewy509) wrote in message news:<33******* *************** ****@posting.go ogle.com>...
Session Data:
HRM_App|O:7:"hr m_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_secu rity";i:1;s:3:" msg";s:0:"";s:1 5:"defaultRedir ect";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_secu rity";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_secu rity";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
3310
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 and a couple "better pratice" code. Not perfect, but better. Problem : I'm testing everything with Firefox on my machine (IIS on WinXP Pro), and everything is ok. As soon as I try MS IE 6, it doesn't seem to keep the sessions from page to...
9
3664
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
1710
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 way to store session data. 1) use the (string)Session approach Obviously bad for maintenance, readability etc. 2) have a typed MySession object with static properties for each value I want to store
5
2458
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 variables and all of them are being stored into session and accessed from session and individual session object. Example: Session = "XYZ", Session=100, Session="NAME", etc.
2
2294
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 In the current release of our system, we decided to "wrap" the ASP.NET Session and Application objects to improve code clarity and accuracy. For example, instead of: Session = new SomeListClass;
5
2091
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 store, there is only one complicated object in this Session, but to get it on SessionStart to make a copy this is a problem. Maybe using Application or whatever? Or this data is divided and inaccessible anyway? Just D.
3
2535
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 redirect to my search.aspx. Here I have a form which allows fill in some fields (place, street, name etc.). With this informations i build a sqlquerey for sqlserver, fill a datagrid and after select the right record by usin a link behind I save the...
0
3240
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 documentation it seems it should do it anyway any advice?
43
3440
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
9685
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10244
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10021
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9061
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7558
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6802
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5454
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5582
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3744
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.