473,799 Members | 2,942 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

$_SESSION comes empty on next page

Hello all,

I am not able to find the solution to this problem :(.
I have two php pages . On the first page i am getting some values in
$_SESSION when i use print_r function. I don't get the values when i
use just echo() or print() functions.
Now, the first page calls the second php page. But when i try to get
the values for $_SESSION on the second page i get empty values even
when i use print_r() function.
register.global s is set to on in php.ini. I am also using
start_session() on these pages but to no effect.

Can any one pleez help me out ??? Any kind of help will be
appreciated.

Thanks in advance.
Jul 17 '05 #1
4 12300

"tornado" <to********@yah oo.com> wrote in message
news:c8******** *************** **@posting.goog le.com...
Hello all,

I am not able to find the solution to this problem :(.
I have two php pages . On the first page i am getting some values in
$_SESSION when i use print_r function. I don't get the values when i
use just echo() or print() functions.
Now, the first page calls the second php page. But when i try to get
the values for $_SESSION on the second page i get empty values even
when i use print_r() function.
register.global s is set to on in php.ini. I am also using
start_session() on these pages but to no effect.

Can any one pleez help me out ??? Any kind of help will be
appreciated.

Thanks in advance.


It'd be useful to see your code... Post it up. It's quite tricky to give
advice on a potentially tricky issue if there's no source code to look at.

Plankmeister.
Jul 17 '05 #2
"tornado" <to********@yah oo.com> wrote in message
news:c8******** *************** **@posting.goog le.com...
I have two php pages . On the first page i am getting some values in
$_SESSION when i use print_r function. I don't get the values when i
use just echo() or print() functions.
Now, the first page calls the second php page. But when i try to get
the values for $_SESSION on the second page i get empty values even
when i use print_r() function.


I had a similar problem recently (Win2000, IIS), and it turned out that PHP
did not have write-access to whatever directory that the session data was
stored in. You may want to look into this.

Chris Finke
Jul 17 '05 #3
The session ID is different for each window instance. So if this is a new
instance of a window you will need to pass the session id to the new window
when you launch it.

If it is in the same browser window then you should be able to get session
variables without passing the variable.

"tornado" <to********@yah oo.com> wrote in message
news:c8******** *************** **@posting.goog le.com...
Hello all,

I am not able to find the solution to this problem :(.
I have two php pages . On the first page i am getting some values in
$_SESSION when i use print_r function. I don't get the values when i
use just echo() or print() functions.
Now, the first page calls the second php page. But when i try to get
the values for $_SESSION on the second page i get empty values even
when i use print_r() function.
register.global s is set to on in php.ini. I am also using
start_session() on these pages but to no effect.

Can any one pleez help me out ??? Any kind of help will be
appreciated.

Thanks in advance.

Jul 17 '05 #4
to********@yaho o.com (tornado) wrote in message news:<c8******* *************** ***@posting.goo gle.com>...
Hello all,

I am not able to find the solution to this problem :(.
I have two php pages . On the first page i am getting some values in
$_SESSION when i use print_r function. I don't get the values when i
use just echo() or print() functions.
Now, the first page calls the second php page. But when i try to get
the values for $_SESSION on the second page i get empty values even
when i use print_r() function.
register.global s is set to on in php.ini. I am also using
start_session() on these pages but to no effect.

Can any one pleez help me out ??? Any kind of help will be
appreciated.

Thanks in advance.


1-have you set session.save_pa th ?
2-if you are using virtualhosts put this at the top of your .php file:
session_set_coo kie_params(3200 , '/', $_SERVER['HTTP_HOST']);
Jul 17 '05 #5

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

Similar topics

0
884
by: Mariame | last post by:
Hello Everyone i have a session for username & i check every page that : if session("username")="' then response.redirect("Login.aspx") the problem is everytime the user refresh the page the session become empty & its redirect to the login page, What can i do so that the session doesent lose its value??????????????? Regards
8
5963
by: Alex Murphy | last post by:
The first page have the pre-define variable. How to transfer to next php page? Thanks
2
1516
by: RAM | last post by:
Hello, I am learning ASP.NET 2.0. Could you explain me please the difference when to use fields of a System.Web.UI.Page-derived class and whem I must use Session variable instead. For example I have a class PZ : System.Web.UI.Page and I need to remember CurrentPosition (int) of asp:DataList. Can I use private field of PZ class (even in multiuser ASP.NET application) or I have to use Session? For unknown reason I have null in...
2
1230
by: noumanislam | last post by:
Hello! this is Nouman. I am working on a form which takes input in text boxes compare those inputted values to a database table... this goes very well.. the problem comes when i want to show the textbox value on the next successful redirect page.. how do i carry those values to next page.... :s
9
9921
by: ajos | last post by:
Hello friends, After thinking about this for sometime, i decided to post this in the java forum. Well my problem here in detail is, i have 3 jsp pages where in a.jsp(for example) i have a combo box, based on the selection of the value in that combo box, b.jsp page gets populated with the value associated to a.jsp, and again based on the selection of value of the 2nd combobox my 3rd combo box gets populated, which is in c.jsp. I'm able to...
2
3708
by: ganesh22 | last post by:
Hi, Iam using like this string gs=Session.ToString(); but in my code Session is empty so its giving some runtime error now i want to give condition that if session is empty i want to do another process how to give condition if session is empty
4
3886
by: madhumy | last post by:
I am having Arraylist containg list of data, Now I am using a Session variable concept to Pass the Arraylist to next page, Instead I want to use Querystring method, can it be done? I need code help.
5
1990
by: whiskyman | last post by:
Hi all, New to posting on this forum and trying to get my add page to wish list working correctly. Passing the code and type variables through to this page and echos fine. But when trying to add my database results into an array I am getting the Resource id #4. The code I am using is below without the dasebase password. <?php include 'session.php'; $con = mysql_connect("94.136.61.138", "xxxxx", "xxxx"); setcookie ('basket', $cart); ...
1
3842
by: A K C MOHAN | last post by:
I have 10 php pages, each page containing ten fields approximately. When I navigate from one page to another page like nextpage>>> & previouspage<<<. How can I store the field values using sessions in php, when he fill first page and select link next page and coming to previous page.
1
1800
by: Don Habibi | last post by:
Working in Visual Studio 2010 and ASP 4.0. Getting a Session Start on every page load and all session data is lost. Switched to cookies and same thing all data is lost when switching from page to page. Session time out is set to several minutes so should not be getting a session start on every page load. I am even getting application start and end on page loads. From what I have read this is a problem after ASP 2.0 but there must be a fix...
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
9538
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
10473
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...
1
10219
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
10025
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
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
7563
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
6804
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();...
1
4138
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

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.