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

SESSION variables not available an all pages

<?
session_start();
print_r($_SESSION);
?>
How come when I put this code on one page it says:
Array ( [userid] => 24 [loginid] => 1 )

but if I put it on another page it simply says:
Array ( )

What is going on ? I thought the session variables were suppost to be
available to any page
Aug 5 '05 #1
4 1649

"meltedown" <gr*****@reenie.org> wrote in message
news:Ds*********************@fe02.news.easynews.co m...
<?
session_start();
print_r($_SESSION);
?>
How come when I put this code on one page it says:
Array ( [userid] => 24 [loginid] => 1 )

but if I put it on another page it simply says:
Array ( )

What is going on ? I thought the session variables were suppost to be
available to any page


You need session_start() at the beginning of EVERY SINGLE PAGE that uses
session variables.

Shelly
Aug 5 '05 #2
Shelly wrote:
"meltedown" <gr*****@reenie.org> wrote in message
news:Ds*********************@fe02.news.easynews.co m...
<?
session_start();
print_r($_SESSION);
?>
How come when I put this code on one page it says:
Array ( [userid] => 24 [loginid] => 1 )

but if I put it on another page it simply says:
Array ( )

What is going on ? I thought the session variables were suppost to be
available to any page

You need session_start() at the beginning of EVERY SINGLE PAGE that uses
session variables.

Shelly

Yes that what I have. The code I posted is on both pages.
Aug 5 '05 #3

meltedown wrote:
<?
session_start();
print_r($_SESSION);
?>
How come when I put this code on one page it says:
Array ( [userid] => 24 [loginid] => 1 )

but if I put it on another page it simply says:
Array ( )

What is going on ? I thought the session variables were suppost to be
available to any page


How are you invoking the scripts? Sessions are on a per domain basis
and also per browser type and window.

We need more details.

Ken

Aug 6 '05 #4
Ken Robinson wrote:
meltedown wrote:
<?
session_start();
print_r($_SESSION);
?>
How come when I put this code on one page it says:
Array ( [userid] => 24 [loginid] => 1 )

but if I put it on another page it simply says:
Array ( )

What is going on ? I thought the session variables were suppost to be
available to any page

How are you invoking the scripts? Sessions are on a per domain basis
and also per browser type and window.

We need more details.

Ken

I had one page open in one firefox tab and the other open in another
tab. Everything else was the same. Right now, I can't seem to get it to
happen again. Both tabs are accessing the variables.
Aug 6 '05 #5

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

Similar topics

9
by: Xizor | last post by:
Let's say I run a server. I have two people using the server. Bill and Joe. Bill is at address.com/bill and Joe is at address.com/joe. Let's say Joe and Bill are both using PHP with sessions on...
14
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...
3
by: Jessica Loriena | last post by:
I'm trying to write a simple "register form / validate and store in database / show welcome screen" application with ASP.Net. With conventional ASP, I used Session variables and it went something...
2
by: Joe Molloy | last post by:
Hi, This isn't a mission critical question but I thought I'dl throw it out there for your feedback as it's a bit curious. I have developed a shopping cart for an application I'm working on...
8
by: Radu Colceriu | last post by:
HI, I've an asp.net app like this: login.aspx (no frame) :- save in session the user and pass -> framedoc.html :- frameset 2 content 1. menu.aspx...
14
by: Coleen | last post by:
Hi All :-) We have an APSX application using VB.net as the code behind, which uses one or two session variables per page. These Session variables are passed to the final page and calculations...
5
by: juan | last post by:
What are session variables in a web page of ASPX (Visual Basic NET)? Thanks.
3
by: Phillip N Rounds | last post by:
I'm writing a user control which has two states: Active & InActive. I additionally am required that there to be only one active control per page, and all logic has to be contained within the...
3
by: panic | last post by:
hello, In my web app when some button is clicked, a new thread is created to import data and that thread creates some threads too, inside those threads some session variables are updated, but...
16
by: emajka21 | last post by:
I created a website in ASP 2.0/c# that connects to an Access 2000 database. Currently I have 4 pages that people can view without logging in, which are reports that post marathon race results. Only...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

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.