close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 or 2018 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Session values not clearing

Thread began 9/21/2009 9:03 pm by Travis250923 | Last modified 9/22/2009 9:38 pm by Travis250923 | 1360 views | 2 replies |

Travis250923

Session values not clearing

I think this may be something with my local test environment as I had a problem like this before but when I put it up on the live host it worked (I don't have hosting for this site yet). I can not get my session values to clear. Here is the code I have:

<?php
if (isset($_POST["logoutButton"])){
// WA_ClearSession
$clearAll = TRUE;
$clearThese = explode(",","");
if($clearAll){
foreach ($_SESSION as $key => $value){
unset($_SESSION[$key]);
}
}
else{
foreach($clearThese as $value){
unset($_SESSION[$value]);
}
}
}
?>

Sign in to reply to this post

Jason ByrnesWebAssist

Assuming there is a logoutButton form element on the page, I dont see a problem with the code.

I would use a hidden form element for the log out trigger to get around an IE bug where the submit button is sometimes not sent with the form:

html:
<form id="form1" method="post" action="logout.php">
<strong>
<input name="logoutButton" type="hidden" id="logoutButton" value="Log Out" />
</strong>
<label>
<input type="submit" name="button" id="button" value="Log Out" />
</label>
</form>




and add the clear session value to the logout.php page.

Sign in to reply to this post

Travis250923

Ah-ha. I forgot to place the action on the form so it wasn't posting anywhere. Duh.

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