Jump to content

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>';
}

?>

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.