Jump to content

$_SESSION question:


tcorbeil

Recommended Posts

Is there a maximum amount of variables you can stack into a session array?

 

I have this:

 

$_SESSION['count'] = $first;

$_SESSION['blah'] = $first;

 

echo $_SESSION['blah']."--";

echo $_SESSION['count'];

 

the result is always the same, $_SESSION['count'] = $first; seems to take but the second does not.. I do have several other session values.. just wondering if I reched my limit??  I have tried everything I could think of but no go..

 

T.

Link to comment
https://forums.phpfreaks.com/topic/47235-_session-question/
Share on other sites

well here goes:

 

yes i do have the Session start..

 

I was trying to use a counter to load a session array..

 

while ($i < $num) {

 

..some code assigning a value to $first...

 

$_SESSION[$i] = $first;

$_SESSION['blah'] = $first; // for troubleshooting I added a this line..

$_SESSION['count2'] = $i;

 

echo $_SESSION['blah']."--";

echo $_SESSION['count2'];

}

on echo, $_SESSION['count2'] = $i; always took so i rem'd out the $_SESSION[$i] = $first; line and it seemed to work.. of course, $i being a counter, I guess this is not acceptable..

 

Any ways around this? I can't use a hardwired string to load the session array as the values will change all the time..

 

 

Link to comment
https://forums.phpfreaks.com/topic/47235-_session-question/#findComment-230386
Share on other sites

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.