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
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
Share on other sites

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.