473,799 Members | 3,163 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

$_SESSION, session_is_regi stered

B-B
Platform: Win2k Server, Apache 1.3, PHP 4.2.3

I understand that when using $_SESSION variables, using the
"session_regist er()" function should not be done. I have seen no
documentation pertaining the the "why" of this, but I am removing the
offending statements from my code anyway.

Prior to discovering this tidbit, I had been attempting to save some arrrays
in individually registered variables. But the arrays were not being saved
between pages.

I have also attempted to save the array in a $_SESSION variable (e.g.
$SESSION['XYZ']=$XYZ, xyz being an array); still no joy (the data seems to
be ending up in the $_SESSION variable, but again it is not saved between
page requests).

"register_globa ls" is set to "On" in the INI file.

So, to the PHP world at large I ask "what am I missing"?

thanks


Jul 17 '05 #1
4 6166
B-B wrote:
I have also attempted to save the array in a $_SESSION variable (e.g.
$SESSION['XYZ']=$XYZ, xyz being an array); still no joy (the data
seems to be ending up in the $_SESSION variable, but again it is not
saved between page requests).
Have you looked at session_start() ...

*************** *************** *************** ****
session_start() creates a session (or resumes the current one based on
the session id being passed via a GET variable or a cookie).
If you want to use a named session, you must call session_name()
<function.sessi on-name.html> before calling session_start() .
This function always returns TRUE.
Note:
If you are using cookie-based sessions, you must call session_start()
before anything is output to the browser.
session_start() will register internal output handler for URL rewriting
when trans-sid is enabled. If a user uses ob_gzhandler or like with
ob_start() <function.ob-start.html>, the order of output handler is
important for proper output. For example, user must register
ob_gzhandler before session start.
*************** *************** *************** ****

"register_globa ls" is set to "On" in the INI file.


People here tell me it should be off....
--
Spam:newsgroup( at)cr*********@ verisign-sux-klj.com
EMail:<01100011 001011100110001 001110101011100 10011010110
110010101000000 011000110111001 001100001011110 10011011100
110000101110010 001011100110001 101101111011011 0100100000>
Jul 17 '05 #2
"B-B" <b~r~i~a~n-at-b~o~n~a~n~z~a~p ~r~e~s~s~-dotcom> schrieb:
I have also attempted to save the array in a $_SESSION variable (e.g.
$SESSION['XYZ']=$XYZ, xyz being an array); still no joy (the data seems to
be ending up in the $_SESSION variable, but again it is not saved between
page requests).

"register_globa ls" is set to "On" in the INI file.
Ooops. In that case your program might overwrite the variable.
So, to the PHP world at large I ask "what am I missing"?


Are you sure that your seesion id is transported to the next page via
gookies or get-parameter?

Regards,
Matthias
Jul 17 '05 #3
B-B
I did finally get things to work properly, thank you to those who responded.
"B-B" <b~r~i~a~n-at-b~o~n~a~n~z~a~p ~r~e~s~s~-dotcom> wrote in message
news:vo******** ****@corp.super news.com...
Platform: Win2k Server, Apache 1.3, PHP 4.2.3

I understand that when using $_SESSION variables, using the
"session_regist er()" function should not be done. I have seen no
documentation pertaining the the "why" of this, but I am removing the
offending statements from my code anyway.

Prior to discovering this tidbit, I had been attempting to save some arrrays in individually registered variables. But the arrays were not being saved
between pages.

I have also attempted to save the array in a $_SESSION variable (e.g.
$SESSION['XYZ']=$XYZ, xyz being an array); still no joy (the data seems to
be ending up in the $_SESSION variable, but again it is not saved between
page requests).

"register_globa ls" is set to "On" in the INI file.

So, to the PHP world at large I ask "what am I missing"?

thanks

Jul 17 '05 #4
I am having the same problem and I have already posted a message on
the board, but its not visible to the public yet.

Could you please let me know ho did u get it to work. I have
register_global s OFF.

Thanks a bunch.
Avinash
"B-B" <b~r~i~a~n-at-b~o~n~a~n~z~a~p ~r~e~s~s~-dotcom> wrote in message news:<vo******* *****@corp.supe rnews.com>...
Platform: Win2k Server, Apache 1.3, PHP 4.2.3

I understand that when using $_SESSION variables, using the
"session_regist er()" function should not be done. I have seen no
documentation pertaining the the "why" of this, but I am removing the
offending statements from my code anyway.

Prior to discovering this tidbit, I had been attempting to save some arrrays
in individually registered variables. But the arrays were not being saved
between pages.

I have also attempted to save the array in a $_SESSION variable (e.g.
$SESSION['XYZ']=$XYZ, xyz being an array); still no joy (the data seems to
be ending up in the $_SESSION variable, but again it is not saved between
page requests).

"register_globa ls" is set to "On" in the INI file.

So, to the PHP world at large I ask "what am I missing"?

thanks

Jul 17 '05 #5

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

Similar topics

0
2489
by: Phil Powell | last post by:
What is the most standardized method of utilizing the CURL functions in PHP (version 4.3.2) to be able to retrieve the contents of a remote URL that happens to be dependent upon $_SESSION for its content display? I've tried the following class methods for display and I have most everything working until I get to a URL that requires $_SESSION: class Timer extends View {
7
2329
by: jerrygarciuh | last post by:
Hi folks, I am working with PHP 4.3.8, Linux, and Apache 1.3.31 on a third-level or sub domain. The following code will diplay foo, session_id(), and increment count over refreshes: <?php session_start();
21
3073
by: axlq | last post by:
Someone please tell me if I've discovered a PHP bug. I'm sitting in front of several computers on my home network, behind a NAT firewall/router. I am testing my web site on these different computers (running different browsers, logged in as different users, etc.). My web site keeps track of users logged in through the use of $_SESSION. Here's the bizarre thing: All computers are logged off, then I log into my web site with one...
12
41196
by: Michael Windsor | last post by:
I've been trying to integrate some PHP pages of my own with some existing code. The details of this are for the support forums for that code (where I have been asking questions), but I wonder if someone here can enlighten me as to why the problematic code is having the effect it is. For reasons I don't know, if the PHP version is 5 or greater, register_long_arrays is false and $_SESSION exists, the following statement is executed: ...
2
1822
by: somecrazyguy | last post by:
Take the following code, one would think that there was absolutely no link between $test and $_SESSION. But if you reload the page, guess what... "After=FAILED". Why? Because for some reason, writing to $test affects the $_SESSION variable $_SESSION. session_start(); ini_set("session.gc_maxlifetime","3600"); if ($_REQUEST == "1") session_unset(); var_dump($_SESSION); if (!$_SESSION) $_SESSION = "Test"; echo...
4
2349
by: dpinion | last post by:
Greetings, I am trying to do some simple session stuff. However it does not seem as though the session variable is being created for my site. I am running the latest version of PHP and apache that I installed as part of WAMP. Machine is XP SP2. Basically I am trying to do something simple such as: <?php
4
2052
by: Pseudonyme | last post by:
Dear Sirs and Madams, Receive as information that storing a MYSQL result under $_SESSION was accelerating web page displays processes ? Absolutly needed but impossible to get this working ! I try, but do not succeed in implement $_SESSION with MYSQL. <?php session_start();
2
2268
by: sharonDonnelly | last post by:
Hi Really dumb problem that's got me beat. Can someone help. The prolem: I'm trying to count the number of times an item has been clicked. There are many items. I want to create a session variable for each item as its clicked, and increment the value held by the session variable by 1 each time that item is clicked. My plan was to allow an item to be selected on one page - when a user selects an item, a numeric value will be passed to a...
3
2183
by: JRough | last post by:
I want to save two variables in a $_SESSION for use in another page: $_SESSION = $mark; $_SESSION = $num; then on the other page I did this to get the value: $mark =$_SESSION; $num = $_SESSION;
0
9686
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
10475
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10250
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...
1
10222
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9068
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
7564
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
6805
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
5463
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
5585
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.