close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

How to keep the user logged in after the successful transaction.

Thread began 11/09/2011 9:13 am by adamop11392849 | Last modified 11/09/2011 9:43 am by adamop11392849 | 741 views | 1 replies

adamop11392849

How to keep the user logged in after the successful transaction.

I am using eCart 4. I run the site in localhost and I use the paypal express checkout sandbox to test the payments. I have seen that I must clear the session variables otherwise the cart stays with its previous content and the order summary and details tables do update and not insert of the subsequence order submission. To clear the session I put this code at the end of the pp_checkout_success.php page.
<?php
if (!session_id()) session_start();
unset($_SESSION);
session_destroy();
?>
But this code clears also and the logged in session variables that is the user is getting logged out. I tried this code to keep the user logged in
<?php
$sid=$_SESSION['sid'];
$semail=$_SESSION['semail'];
$sname=$_SESSION['sname'];
$scheck=$_SESSION['scheck'];
if (!session_id()) session_start();
unset($_SESSION);
session_destroy();
if (!session_id()) session_start(); &#61663;----- This is line 344
if (!isset($_SESSION['sid'])) $_SESSION['sid']=$sid;
if (!isset($_SESSION['semail'])) $_SESSION['semail']=$semail;
if (!isset($_SESSION['sname'])) $_SESSION['sname']=$sname;
if (!isset($_SESSION['scheck'])) $_SESSION['scheck']=$scheck;
?>
By this way the user stays logged in, the cart empties and subsequence order works normally but I get the following warning

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\Program Files\xampp\htdocs\pp_checkout_success.php:132) in C:\Program Files\xampp\htdocs\pp_checkout_success.php on line 344

Line 132 is inside the template code and handles the logged in information for the whole site
I would be grateful for any help

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