Jump to content

PHP Sessions Array problem on Linux


cypr

Recommended Posts

Hi all,

 

I have a little problem on using Session Arrays  in Linux.... I'm on Ubuntu and the PHP installed is the one that xampp gives me :-"...now..i started some scripts on windows (yes, Xampp :-") I did not configure anything ....everything except the Database security is Xampp default.... And i'm working on the latest version.... php is 5.x something ..

now..the problem:

 

If I use

session_start();
$_SESSION['x'] = "aaa";

the session is saved but if I try multiple array....

session_start();
$_SESSION['x']['y']['z'] = "aaa";

the session is not recognized anymore  :(  :'( .. this worked in windows.....

hmm.... do i hafeto chmod 777 the ram too? :)) (joking)

now, all the folders and files have maximum permissions...

I am using

session_start();
corectly,

I tested with echo everything I could ever test....

it seems that afther my tests, it was giving an error if I was trying to override the sessions when I was creating them..... so I had to UNSET them......

I cannot unset them again in the file that I am using them because I need the values,,....

 

AGAIN!```````` THIS WORKES ON WINDOWS !

 

Thanks ,

cypr

 

Link to comment
https://forums.phpfreaks.com/topic/65498-php-sessions-array-problem-on-linux/
Share on other sites

Should work fine no matter what OS you use.

 

try a simple test on linux and windows with this:

<?php

session_start();

if(isset($_GET['n']) && $_GET['n'] == '1')
{
    echo '<pre>' . print_r($_SESSION, true) . '</pre>';
}
else
{
    $_SESSION['x']['y']['z'] = "aaa";

    echo '<a href="?n=1">Next</a>';
}

?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.