473,394 Members | 1,737 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,394 software developers and data experts.

$_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.globals 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 12273

"tornado" <to********@yahoo.com> wrote in message
news:c8*************************@posting.google.co m...
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.globals 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********@yahoo.com> wrote in message
news:c8*************************@posting.google.co m...
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********@yahoo.com> wrote in message
news:c8*************************@posting.google.co m...
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.globals 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********@yahoo.com (tornado) wrote in message news:<c8*************************@posting.google.c om>...
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.globals 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_path ?
2-if you are using virtualhosts put this at the top of your .php file:
session_set_cookie_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
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...
8
by: Alex Murphy | last post by:
The first page have the pre-define variable. How to transfer to next php page? Thanks
2
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...
2
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...
9
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...
2
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...
4
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
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...
1
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...
1
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.