I have been having error messages relating to a session variable. I did
a print_r of the $session and I got the following results
Array ( [language] => english [languages_id] => 1 [selected_box] =>
configuration [IsAdminLoggedIn] => 1 )
Fatal error: Session variable IsAdminLoggedIn is not globally defined
As you could see in the print out, the variable IsAdminLogged in is set
and yet I get the error message, does anyone know what is going on?
Thanks 12 1646
do you have any code to demonstrate the problem?
konstantin
<ef*****@epitome.com.sg> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com... I have been having error messages relating to a session variable. I did a print_r of the $session and I got the following results
Array ( [language] => english [languages_id] => 1 [selected_box] => configuration [IsAdminLoggedIn] => 1 ) Fatal error: Session variable IsAdminLoggedIn is not globally defined
As you could see in the print out, the variable IsAdminLogged in is set and yet I get the error message, does anyone know what is going on? Thanks
konsu wrote: do you have any code to demonstrate the problem? konstantin
<ef*****@epitome.com.sg> wrote in message news:11**********************@f14g2000cwb.googlegr oups.com...I have been having error messages relating to a session variable. I
did a print_r of the $session and I got the following results
Array ( [language] => english [languages_id] => 1 [selected_box] => configuration [IsAdminLoggedIn] => 1 ) Fatal error: Session variable IsAdminLoggedIn is not globally
defined
As you could see in the print out, the variable IsAdminLogged in is
set and yet I get the error message, does anyone know what is going on? Thanks
Konstantin
This is the code I had in my pages
<?php
session_start ();
// Use $HTTP_SESSION_VARS with PHP 4.0.6 or less
if (!isset($_SESSION['IsAdminLoggedIn'])) {
//(!isset($_SESSION['IsAdminLoggedIn']))
header("Location: index_login.php?ALE=0");
}
?>
I hope this shed some light on how I used the session variable.
Regards
i placed this code in to a separate php file and it displayed 'ok':
<?php
session_start ();
if (!isset($_SESSION['IsAdminLoggedIn']))
{
echo('ok');
}
?>
must be a configuration problem on your server. ef*****@epitome.com.sg wrote: I have been having error messages relating to a session variable. I
did a print_r of the $session and I got the following results
Array ( [language] => english [languages_id] => 1 [selected_box] => configuration [IsAdminLoggedIn] => 1 ) Fatal error: Session variable IsAdminLoggedIn is not globally defined
As you could see in the print out, the variable IsAdminLogged in is
set and yet I get the error message, does anyone know what is going on? Thanks
No, the variable $_SESSION['configuration']['IsAdminLoggedIn'] is set.
That is different.
Change your code to reflect this.
Also, when using print_r on arrays, use:
echo '<pre>';print_r ($array);echo '</pre>';
This will format the dump much prettier on the screen.
Ken
Konsu
Thanks for trying that out, do you know what settings on the server
could affect the session variable?
konsu wrote: i placed this code in to a separate php file and it displayed 'ok':
<?php session_start (); if (!isset($_SESSION['IsAdminLoggedIn'])) { echo('ok'); } ?>
must be a configuration problem on your server. ef*****@epitome.com.sg top-posted: ... do you know what settings on the server could affect the session variable?
I could bet that "session.save_path" is badly configured.
--
Mail to my "From:" address is readable by all at http://www.dodgeit.com/
== ** ## !! ------------------------------------------------ !! ## ** ==
TEXT-ONLY mail to the whole "Reply-To:" address ("My Name" <my@address>)
may bypass my spam filter. If it does, I may reply from another address!
Pedro Graca wrote: ef*****@epitome.com.sg top-posted: ... do you know what settings on the server could affect the session variable? I could bet that "session.save_path" is badly configured.
-- Mail to my "From:" address is readable by all at http://www.dodgeit.com/ == ** ## !! ------------------------------------------------ !! ## **
== TEXT-ONLY mail to the whole "Reply-To:" address ("My Name"
<my@address>) may bypass my spam filter. If it does, I may reply from another
address!
Hi
I found that my session.save_path was set to a folder called /tmp
which didn't exist. I created the folder in the directory but
unfortunately no effect.
I was wondering if "register_globals" function is needed to be turned
on on hte server as on mine it is set to off. ef*****@epitome.com.sg wrote: Pedro Graca wrote: I could bet that "session.save_path" is badly configured. I found that my session.save_path was set to a folder called /tmp which didn't exist. I created the folder in the directory but unfortunately no effect.
If you don't want to change php.ini, create the "tmp" directory under
the root directory ("C:\tmp")
Or change php.ini so that session.save_path points to an *existing*
directory and then restart your web-server,
I was wondering if "register_globals" function is needed to be turned on on hte server as on mine it is set to off.
No, no need to turn register_globals on.
--
Mail to my "From:" address is readable by all at http://www.dodgeit.com/
== ** ## !! ------------------------------------------------ !! ## ** ==
TEXT-ONLY mail to the whole "Reply-To:" address ("My Name" <my@address>)
may bypass my spam filter. If it does, I may reply from another address!
My hosting provider has C:\tmp created and re-started the server, Still
no luck.
Sorry if this is a stupid question.
Since the variable [IsAdminLogged] exists when I printed $_session, why
does it not picked up for line
if (!isset($_SESSION['IsAdminLoggedIn']))
logically it should,. Shouldn't it? ef*****@epitome.com.sg wrote: My hosting provider has C:\tmp created and re-started the server, Still no luck.
Sorry if this is a stupid question.
Since the variable [IsAdminLogged] exists when I printed $_session, why does it not picked up for line
if (!isset($_SESSION['IsAdminLoggedIn'])) logically it should,. Shouldn't it?
No, bcause you set one variable, and test one with another name, perhaps?
I'll try that. Thanks for your suggestion. Will update everyone on the
outcome.
Steve wrote: ef*****@epitome.com.sg wrote: My hosting provider has C:\tmp created and re-started the server,
Still no luck.
Sorry if this is a stupid question.
Since the variable [IsAdminLogged] exists when I printed $_session,
why does it not picked up for line
if (!isset($_SESSION['IsAdminLoggedIn'])) logically it should,. Shouldn't it?
No, bcause you set one variable, and test one with another name,
perhaps?
I tried what Steve suggested and replaced IsAdminLogged with Language
and I didn't get any error. What does this suggest? Does it mean the
variable IsAdminLogged wasn't set correctly?
Regards ef*****@epitome.com.sg wrote: I'll try that. Thanks for your suggestion. Will update everyone on
the outcome.
Steve wrote: ef*****@epitome.com.sg wrote: My hosting provider has C:\tmp created and re-started the server, Still no luck.
Sorry if this is a stupid question.
Since the variable [IsAdminLogged] exists when I printed
$_session, why does it not picked up for line
if (!isset($_SESSION['IsAdminLoggedIn'])) logically it should,. Shouldn't it?
No, bcause you set one variable, and test one with another name, perhaps? This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Paul |
last post by:
Hmmm, didn't seem to work. I have set session.use_cookies = 1 and
session.use_trans_sid = 1 in my php.ini file. Index.php contains:...
|
by: doltharz |
last post by:
Please Help me
i'm doing something i though was to be REALLY EASY but it drives me
crazy
The complete code is at the end of the email
(i mean newsgroup article),
i always use Option...
|
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...
|
by: Mark Rodrigues |
last post by:
Hi Everyone,
I have been fighting a problem for a while and I wonder if someone out
there can help.
This problem has been presented in a number of news postings
previously but I am yet to see a...
|
by: Werner |
last post by:
Hi Patrick!
Can you give an example of how to use a frameset inside an aspx-file?
When I create a new frameset in Visual Studio.Net it just gives me a htm-File.
Or give me a link where I can...
| |
by: Alexander Widera |
last post by:
hi,
who has seen the follow problem or could help please?
i visit a page .... i read a sesssion-var . ... everythink works...... i
visit the page again..... error ... the sessionvar is null .... i...
|
by: jcr |
last post by:
Hi:
I am having trouble dynamically setting a variable. The following
code does not work. Any ideas would greatly be appreciated.
Thanks,
Jim
Dim astr As String
Dim bstr As String
Dim...
|
by: cashdeskmac |
last post by:
I have put a string into Session and tried to retrieve it on the next page I
visit but the Session appears empty. I have exactly the same spelling for
both adding and retrieving the value:
...
|
by: Orgil |
last post by:
I'm using ASP 3.0 however there is ASP.NET, because I'm working an old
site that is built in ASP 3.0.
I hope you for getting any help for my problem from you.
So, my site's sessions are empty...
|
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...
|
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,...
| |
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...
|
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...
|
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: 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...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| | |