close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

WA_ClearSession not clearing sessions?

Thread began 10/15/2019 5:39 am by Nathon Jones Web Design | Last modified 10/16/2019 9:18 am by Ray Borduin | 631 views | 4 replies |

Nathon Jones Web Design

WA_ClearSession not clearing sessions?

I'm sure this was resolved previously, but the following code is not wiping session values. This code is on our checkout_success.php page:

<?php 
@session_start();
if (!isset($_GET['framed'])){
// WA_ClearSession
$clearAll = FALSE;
$clearThese = explode(",","PayPal_ECO_Token,PayPal_ECO_PayerID,eCartSMC_Items,eCartSMC_OrderID,NEWuserID,NEWformID");
if($clearAll){
foreach ($_SESSION as $key => $value){
unset($_SESSION[$key]);
}
}
else{
foreach($clearThese as $value){
unset($_SESSION[$value]);
}
}
}
?>



After some digging, I found (http://www.webassist.com/forums/posts.php?id=41903) where you'd previously resolved this, by adding this code:

<script>
if (top.location!= self.location || document.location.href.indexOf("?framed=1") >= 0) {
top.location = self.location.href.replace(/([\?\&])framed=/,"$1unframed=");
}
</script>



...to the checkout_success.php page. However, the sessions are not being wiped, despite this code.
NJ

Sign in to reply to this post

Ray BorduinWebAssist

What is the web site? I'll have to debug it live to determine what the issue is. How do you know it isn't clearing? What session variable is still set and how do you know? It is only set up to delete a few session variables, not the entire session. Maybe you want to change the line to:

$clearAll = TRUE;

Sign in to reply to this post
Did this help? Tips are appreciated...

Nathon Jones Web Design

It's the last one, NEWformID, although I would assume that if that isn't clearing then, likely, the others aren't either.

Once a user gets to checkout_success.php, and then clicks on the "Get Started" option again - to start a new order - the form is already filled in with all the details from the order that's just completed, because the session value for NEWformID is still active.

Thank you
NJ

Sign in to reply to this post

Ray BorduinWebAssist

I had to start the session before the <!doctype> in order to fix this problem. I just added this:

<?php
@session_start();
?>

right on line 79 and that seems to have resolved this issue.

Sign in to reply to this post
Did this help? Tips are appreciated...

Nathon Jones Web Design

Much appreciated. Thank you.
NJ

Sign in to reply to this post

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