close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Problem with checkout pages and session

Thread began 11/27/2011 4:17 pm by Base5 Designs | Last modified 11/29/2011 4:21 pm by Base5 Designs | 1010 views | 3 replies

Base5 Designs

Problem with checkout pages and session

I am very nearly complete on the site i am working on.

I have one last problem to sort out that i think is to do with session variables:

A user is required to log-in before checking out.
and is checked against SESSION['UserGroupID']

If a user has logged in, and enters shipping info on the checkout page then clicks the checkout button, when the order summary with shipping discounts etc is displayed FOR THE FIRST TIME all the details are stored into the database as expected, with no problems.

But if they try to add anything else to the order, change shipping details or navigate away from the confirm page.

Next time they arrive the confirm page the following error occurs:
Unknown column '1d2d1c68fb25abbabad113050281dc8c' in 'where clause'

i can only assume this is the session id, whats going on here?

if they continue with the order from the originals steps (ie clicking checkout instead of changing shipping info, adding to the order, navigaing away) everything works ok they get sent to worldpay the transaction is processed all emails are sent out.

but if they try to make another order the above error happens.

i have added the code from the threads about clearing session variables to my success page, but this is not seeming to clear the session id.
maybe because of the way worldpay calls the response page
the code i have on the end of the response page is:
// Initialize the session.
// If you are using session_name("something"), don't forget it now!
//store the UserID Session Variable
if(isset($_SESSION['UserID']) && $_SESSION['UserID'] != "") {
$UserID = $_SESSION['UserID'];
if(isset($_SESSION['UserGroupID']) && $_SESSION['UserGroupID'] != "") {
$UserID = $_SESSION['UserGroupID'];
// Unset all of the session variables.
$_SESSION = array();
// If it's desired to kill the session, also delete the session cookie.
// Note: This will destroy the session, and not just the session data!
if (isset($_COOKIE[session_name()])) {
@setcookie(session_name(), '', time()-42000, '/');
// Finally, destroy the session.
//Reset the UserID Session Variable
if(isset($UserID) && $UserID != "") {
$_SESSION['UserID'] = $UserID;
if(isset($UserGroupID) && $UserGroupID != "") {
$_SESSION['UserGroupID'] = $UserGroupID;

and thats is not clearing anything from what i can make out, i have checked i am using the correct session names.

Ideally i would prefer that no orders are stored in the database, until the submit order button is pressed.
but the form on the confirm page submits directly to worlpay, if i set the add summary and detail behaviours to execute on submit_buttonname pressed the details dont get added.

i am assumming that if i set the form to submit to itself then my insert summary and details will work. but the redirect on the add cart details to daabase behaviour wont post the formdata to worldpay via post... as it would use get....

so what do i need to do to get all this working??

would appreciate a quick response as the site needs to be live for the 1st december.

have attached my files for you look at

Attached Files
ecart not adding order

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question





Ease of use


security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...