Jump to content

clearing out session variables


SCook

Recommended Posts

Hi gang,

I seem to be having trouble assigning new values to session variables that I've created after they've received an initial values, like so:
$_SESSION['var'] = 25.5;

Then I try to do this:
$_SESSION['var'] = 30.1;

and I get as an output 0.  What's with that?  Thanks.
Link to comment
Share on other sites

Yes, I am using session_start at the tops of each page, as I'm using a session-based secure login.

Now, what's happening is that these values are assigned on the final order page, and then for example, the customer goes back to the home page and places another order.  They then submit it, and it goes to the final order page, where the order info, quantity, price, etc. are reassigned to the session varibles.  Then these are read further down in the page.  I don't have to do this, but some of these values are used again, so it's a convenient method.

Now, because the session variables are still holding the info from the last order, they don't seem to accept new values.
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.