473,602 Members | 2,846 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Arrays in SESSION vars ????

Hi there:

A quick question, if anybody can give me a helping hand?

Can an array be stored in a session variable???? Or will the variable
of the type $_SESSION[...] hold scalar values only?
My attempts failed but that's probably because I did "something" wrong
:-).
I just wanted to be sure before I break my head over something
impossible.

Your answers are greatly appreciated.
Thanks and greetings.

Jul 17 '05 #1
2 4423
Jerry wrote:
Hi there:

A quick question, if anybody can give me a helping hand?

Can an array be stored in a session variable???? Or will the variable
of the type $_SESSION[...] hold scalar values only?
My attempts failed but that's probably because I did "something" wrong
:-).
I just wanted to be sure before I break my head over something
impossible.

Yes, it is very possible :)

<?php
session_start() ;
$_SESSION['user']['name']['first'] = 'Pedro';
$_SESSION['user']['name']['last'] = 'Graca';
$_SESSION['user']['country'] = 'Portugal';
// ...
$array = $_SESSION['user'];
echo '<pre>'; print_r($array) ; echo '</pre>';
?>
--
--= my mail box only accepts =--
--= Content-Type: text/plain =--
--= Size below 10001 bytes =--
Jul 17 '05 #2
Jerry <no**@none.co m> wrote:
Can an array be stored in a session variable????


Please don't multipost.

Cheers;
JOn
Jul 17 '05 #3

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

Similar topics

0
1424
by: james | last post by:
I am new to php and need some help getting the session variables into include files. (after-thought, Sorry for the drawn out post but I really, really need help....;) Here's what I'm doing.. I have a php request_form that I use 2 different ways: by itself (url directly to the form) and as an include to be displayed in existing php pages. This form uses POST to another php_script that performs serverside validation and db write. If all...
13
23295
by: Mimi | last post by:
Hello, I am having trouble using the session vars in PHP 4.3.9 OS: Win XP Prof Web Server IIS (is local and there are no links to other servers from the web pages I work on) Browser: IE 6.0 The problem I am having is that each time I reload the same PHP page, I get
8
3962
by: ndsoumah | last post by:
hello guys I'm trying to get access to variables I put in a session variable from another page and it fails... here's the exact situation main file page1.php
9
3631
by: Pack Fan | last post by:
I've noticed that session variables will persist on Mac IE even after all browser windows have been closed. One must quit the program to clear the session variables. This presents a security risk for my session variable based security scheme. Basically, the risk is that a user will login to my site, close the window when done and allow someone else to come up to the machine, go back to my site and be logged into the previous user's...
1
7960
by: Vetrivel | last post by:
Application architecture : Develop interface between two existing systems, a. Enterprise CRM system b. Web based intranet system. Environment : Intranet Server : IIS and ASP. Script : VBScript and Javascript Client : 1. IE browser. 2. VBForm embedded with WebBrowser control (MS Internet
19
2133
by: Paul Yanzick | last post by:
Hello, I am trying to develop a book tracking application for my capstone in school, and am running into a problem. The application is an ASP.Net application written in C#. The first page you go to is a login form, which will set several session variables with the name used to log in, appropriate security level and some other misc variables, and then will go to a main menu for each particular security level using Server.Transfer. ...
3
3436
by: Mark | last post by:
Ok, I know that .net inherently does not share session data across asp.net projects, but is there any decent work around to this. We already have a big chunk of our application using the asp.net session object (using state service). I'd like to start breaking out our functionality into component projects, but I'd like to get this session issue worked out first. Any ideas?? I found this article , but it sounds like kind of a pain.
5
8892
by: VB Programmer | last post by:
I often use session variables to store the user's security level, and other important info. How secure are session variables? Can someone decrypt it and get the information? (This would be especially important to know if the session vars contain things like credit card numbers.) Any better, more secure alternatives? How would you store credit card numbers etc... temporarily if not using session vars? Thanks!
13
2811
by: Alexander Widera | last post by:
hi, who has seen the follow problem or could help please? i visit a page .... i read a sesssion-var . ... everythink works...... i visit the page again..... error ... the sessionvar is null .... i visit again .... null ... again .... it works ..... again ... it works ... again ..... null....... and so on and on .... it does randomly work or not.... what is this effect?
2
2557
by: Jeff | last post by:
....still new to .net 2005 using VB. Do I understand correctly that the value of a session variable is actually stored in the server's ram, but relies on the asp.net session ID cookie that temporarily is placed on the client's machine until the session ends? ...so that you can't use session variables if the client has disabled cookies on their browser? So, this makes session vars much more secure than hidden fields, which are transmitted...
0
7993
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
7920
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8268
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
6730
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
5867
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
5440
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
3944
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2418
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1254
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.