close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Empty Session Variables with Ecart 4.5.2

Thread began 7/26/2010 4:36 am by kp006274029 | Last modified 8/09/2010 12:23 pm by Eric Mittman | 2244 views | 9 replies |

kp006274029

Empty Session Variables with Ecart 4.5.2

Hi,

I'm using ecart 4.5.2 with PHP 5.2 (running on windows server 2003 web edition as testing server) for some reason when I use an add to cart button to add a product to the cart page; It creates an empty session file on the server, so when you goto the cart page the cart is seen as empty.

If I create a two test pages in PHP create a session variable on one and echo it on the other test page, this works fine and a non-empty session variable is created on the server.

Any help greatly appricated.
KP

Sign in to reply to this post

Eric Mittman

When you are configuring the eCart object you have a choice of using sessions or cookies to store the cart info. Do you have sessions set for this value? Have you tried uploading these files to a live server to see if you have the same result? If you have your cart set to use sessions and you can confirm that sessions are working on your server then the cart should retain it's contents while the session is active. Do you have the cart page set as the redirect in the add to cart server behavior? If so you should be going directly to this page, is this when you see the cart without anything in it? Please post back with all of the detail that you can about this and include a copy of the add to cart page, your cart display page, and the WA_eCart folder from your site root in a zip archive. I will take a look at your pages locally.

Sign in to reply to this post

kp006274029

Hi Eric,

I can confirm that (1) The eCart object is set to store in sessions (2) Press a Add to Cart button creates a empty session file in the sessions folder (3) I've uploaded onto a live server and it works fine (4) Sessions appear to be working fine, i.e. I can create a session variable called test set it to "hello" an echo it onto another page, it also creates a file with the value in it on the testing server. (5) The cart page is set as the redirect in the add to cart behaviour, after being redirected on the testing server the cart is empty.

I've added the zip file as requested, also included my php.ini file just in case you can spot something in it that could be causing the issue.

I'm using PHP version 2.2.13, Also getting the following in the php error log:

[29-Jul-2010 13:27:12] PHP Warning: PHP Startup: Unable to load dynamic library 'C:\Program Files\PHP\ext\php_mssql.dll' - The specified module could not be found.
in Unknown on line 0.

Don't understand why it can't be found considering it is in the specified directory.

Many Thanks

KP

Attached Files
truly-delicious.zip
Sign in to reply to this post

Eric Mittman

When I test your files I'm able to add items to the cart without issue so it seems to me that there might be a session management issue on your server. To help you test the sessions more thoroughly you should add in this code on the pages you are testing so that you can see exactly what is in the session during each step.

php:
<?php

if(!session_id()) session_start();
print(
"<pre>");
var_dump($_SESSION);
print(
"</pre>");
?>



This code will print out the entire session so that you can see all of the values in it. You should add this to your pages then test the site locally and test it again on the live server. Let us know what the differences are between the servers in the results that you get.

Sign in to reply to this post

kp006274029

Hi Eric,

I placed the code at the start of the onlineshop.php and the cart.php files.

It returned the following: array(0) {
}

At the top of both pages on the testing server.

On the live server the onlineshop.php page displays:

array(2) {
["trulydelicious_Items"]=>
string(98) "0|WAECART|choc|WAECART||WAECART|0|WAECART|1|WAECART|2.99|WAECART|0|WAECART|2.99|WAECART|1 choc (0)"
["WAEC_ContinueRedirect"]=>
string(20) "/test/onlineshop.php"
}

If I click the add to cart button it displays the above message with the following warning on the onlineshop.php page

Warning: Cannot modify header information - headers already sent by (output started at /home/t/r/trulydelicious/public_html/test/onlineshop.php:3) in /home/t/r/trulydelicious/public_html/test/onlineshop.php on line 44

I also did the same with sessiontest1.php and sessiontest2.php with the following results:

***Live Server***

sessiontest1.php

array(0) {

}

sessiontest2.php

array(1) {
["test"]=>
string(5) "hello"
}

**Testing Server***

sessiontest1.php

array(0) {
}

sessiontest2.php

array(1) {
["test"]=>
string(5) "hello"
}






KP

Sign in to reply to this post

Eric Mittman

Thanks for posting back with the results. This tells me that you have a session handling problem on your local testing server. I'm not sure what the problem could be since you are able to get a good result with the session testing script. If you remove this code from the pages on the live server they should work without error, make sure to not leave any blank space or returns outside of the php blocks, doing so could cause the same error to occur.

Sign in to reply to this post

kp006274029

Thanks for the help Eric, I've solved the problem. :)

Sign in to reply to this post

Eric Mittman

Glad to hear that, was it a session setting on your local testing server that needed to be adjusted?

Sign in to reply to this post

kp006274029

Hi Eric,

I never did discover the reason, I just gave up and re-installed the entire server and it worked 1st time.

Best Wishes,
KP

Sign in to reply to this post

Eric Mittman

Ok, that is good to know. Glad it is working out for you now.

Sign in to reply to this post
loading

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

Content

rating

Layout

rating

Ease of use

rating

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...