473,398 Members | 2,404 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,398 software developers and data experts.

Re: very basic: session_start();

using session_start() on a script - if there is no session it sets
one up; if there is a session, it opens it. If you wait too long
between pages it disposes the session automatically (set time for
session to keep alive in php.ini).

You need session_start() on all pages that needs to access the
$_SESSION array.

$_SESSION is just like an array variable, so if you want to segregate
data you could set a sub array of page data in $_SESSION...

$_SESSION['views'][1] = ...array of data...;

Hope that helps
Larry
Jun 27 '08 #1
2 1780
using session_start() on a script - if there is no session it sets
one up; if there is a session, it opens it. If you wait too long
between pages it disposes the session automatically (set time for
session to keep alive in php.ini).
Ha! I think that might explain a couple of "strange" events that happen
when I go away and come back later! If I read that right, it's only
about 24 minutes (1440 S). I'm not going to change it because I don't
know the nuances/inter-plays of the php.ini yet. I'm perfectly happy
just knowing there's a reason for it! I've been getting ready to blame
the OS.
>
You need session_start() on all pages that needs to access the
$_SESSION array.

$_SESSION is just like an array variable, so if you want to segregate
data you could set a sub array of page data in $_SESSION...

$_SESSION['views'][1] = ...array of data...;

Hope that helps
Larry
I think I'm starting to catch on; for whatever reason I've been totally
misinterpreting some of these things including $_SESSION. It's always
hardest for me to get the basics into my head when I start something new
like this.

Thanks much

Twayne
Jun 27 '08 #2
On Jun 14, 11:02 am, "Twayne" <nob...@devnull.spamcop.netwrote:
>
You need session_start() on all pages that needs to access the
$_SESSION array.
$_SESSION is just like an array variable, so if you want to segregate
data you could set a sub array of page data in $_SESSION...
$_SESSION['views'][1] = ...array of data...;
I think I'm starting to catch on; for whatever reason I've been totally
misinterpreting some of these things including $_SESSION. It's always
hardest for me to get the basics into my head when I start something new
like this.
Sometimes it's a lot more simpler then you realize.

How to use arrays is a big part of making some cool PHP stuff,
especially how to handle them in form data and in $_SESSION. It's
taken me a while to wrap my brain around it too, but its worth it.
Jun 27 '08 #3

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

Similar topics

3
by: Florence HENRY | last post by:
Hello, I've searched about my problem on google before posting, but I didn't find anything relevant... I have a problem with session_start. Here is my code : <html> <head> <?php...
2
by: Reply-Via-Newsgroup Thanks | last post by:
Folks, I consider myself a reasonably strong PHP programmer, but I've not used sessions before (I've used cookies instead) and I'd appreciate it if someone could confirm something for me. ...
3
by: Trogdor | last post by:
I set up a server on an AMD 650 machine running gentoo linux. I installed Apachie 2, MySQL 4.1 and PHP 4.3.11 I use another computer on my local net (192.168.0.x) to access the server as a...
1
by: Mercy | last post by:
Hi, I'm a newbie. I was trying to figure out how to use the Session_start method? The reference books I'm reading say that a session STARTS when "session_start" is called. But ... in their sample...
8
by: lkrubner | last post by:
I was trying to set a cookie before I called session_start() and it was giving me an error. But isn't sessions really just a cookie? Why would it matter if I sent a cookie before session_start? Can...
5
by: Niklas Uhlin | last post by:
Someone please explain why Session_Start fires multiple times / retains SessionID values between sessions, when you open an ASP.NET page from MS Word. For details of the problem, see below: 1....
19
by: lawrence k | last post by:
How can I find out where my script is outputting to the screen for the first time? My error logs are full of stuff like this: PHP Warning: session_start(): Cannot send session cache...
1
by: Marc E | last post by:
All, I've read the docs on session handling but still can't figure this one out. I'm guessing it's a setting in php.ini or something. I've inherited this code from someone, and it's got a typical...
3
by: kvnsmnsn | last post by:
I've got a piece of PHP code that gets executed twice. The first time through, variable <$Useris unregistered, so message "jqz cbig90" gets printed to the screen as an error message. When I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
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.