cypr Posted August 17, 2007 Share Posted August 17, 2007 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 Quote Link to comment https://forums.phpfreaks.com/topic/65498-php-sessions-array-problem-on-linux/ Share on other sites More sharing options...
wildteen88 Posted August 17, 2007 Share Posted August 17, 2007 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>'; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/65498-php-sessions-array-problem-on-linux/#findComment-327044 Share on other sites More sharing options...
keeB Posted August 17, 2007 Share Posted August 17, 2007 <?php //set it $_SESSION[x][y][z] = 'aaa'; //display it print "<pre>"; print_r($_SESSION); ?> Quote Link to comment https://forums.phpfreaks.com/topic/65498-php-sessions-array-problem-on-linux/#findComment-327066 Share on other sites More sharing options...
cypr Posted August 17, 2007 Author Share Posted August 17, 2007 hmm...if I don't UNSET, I get this error: Warning: Cannot use a scalar value as an array in /opt/lampp/htdocs.............. Quote Link to comment https://forums.phpfreaks.com/topic/65498-php-sessions-array-problem-on-linux/#findComment-327111 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.