PHP 4.3.2 session problems (urgent help needed)

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
dayal_78
Forum Newbie
Posts: 1
Joined: Thu Feb 12, 2004 9:32 am

PHP 4.3.2 session problems (urgent help needed)

Post by dayal_78 »

Hi,

I am using php 4.3.2 on FreeBSD 4.4 and I am having a problem with
sessions.

As part of session variables I am storing an associative array and a simple numeric variable. Randomly, the associative array fails but my application is still able to retrieve the numeric variable from the session.

Is there any bug in PHP 4.3.2 concerning storing associative arrays as session variables? If not, what am I doing wrong.

<?php

session_start();
$ar = array();
$ar["username"] = "xxxx";
$ar["password"] = "yyyy";
$_SESSION["arrayvariable"] = $ar;
$_SESSION["numericvariable"] = 30;

Header("Location: page2.php");
?>

Now on page2,

I am not able to retrieve the associative array some times, but I am able to retrieve the numeric variable all the time.

Can you please tell me whats going wrong??

Thanks
DL
Post Reply