Current location: Hot Scripts Forums » Programming Languages » PHP » Session variables for navigation


Session variables for navigation

Reply
  #1 (permalink)  
Old 04-12-04, 04:28 AM
Puno Puno is offline
Newbie Coder
 
Join Date: Mar 2004
Location: Spain (EU) Colorado (USofA)
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Session variables for navigation

This is provably an odd posting, since I need help getting to work, something which already works...

The code detects wether someone is already logged in and if so, it skips the logging in process which is HTML code after the end of the php code. (not posted here to save space) and sends you to the next page directly.

PHP Code:

 <?php
session_start
();
if (isset(
$_SESSION['login']))
{
 
$usuario $_SESSION['usuario'];
 
$login   $_SESSION['login'];
}
session_unset();
if (isset(
$login))
{
 
$_SESSION['usuario'] = $usuario;
 
$_SESSION['login']   = $login;
}
if (isset(
$login))
{
 if (
$login=='okdokey')
 {
  echo 
"<SCRIPT LANGUAGE=\"javascript\"> \n";
  echo 
"window.location.href = 'verify_2.php'; \n";
  echo 
"</SCRIPT> \n";
 }
}
?>
And here is the kicker, it works perfectly taking into account that the next page sets the value of login to lets say 'okdokey'.
It works just fine in my Windows XP Pro, IIS 5.1 with PHP 4.3.2.2, and mySQL

But in the production server on the 'Net with Linux, Apache, PHP, and mySQL I get no errors but the skipping does not happen.
So can anyone help me? Does the difference in behavior arise from the OS, the web server, some setting?? Any guesses?

Up to this problem all session variables seemed to be working just fine, while we had observed some irregularities with long lived sessions that seemed to be corrected with some session_unset() like the one in the code.

Thanks a lot for your help.
__________________
Puno Bleedingrose,
Spectrum 48K BASIC's was cooler, it had a BEEP instruction.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Server side variables Puno PHP 13 08-13-05 10:22 PM
session help darkcarnival PHP 5 05-09-05 12:40 AM
php session problem.(HELP PLEASE) justme PHP 3 03-22-04 02:47 PM
help with displaying variables tisza PHP 9 12-22-03 05:08 PM
Storing and accessing variables from a session Obakeng Everything Java 0 12-08-03 07:52 AM


All times are GMT -5. The time now is 10:26 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.