close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Terminating a Session After Logout

Thread began 1/17/2016 5:04 am by salaroche | Last modified 1/21/2016 10:31 am by Ray Borduin | 1942 views | 8 replies |

salaroche

Terminating a Session After Logout

Hi:

I have assigned the Logout behavior to a button that when pressed redirects to the Login page, but when another (or the same) user logs in and goes to the insert-record page, the fields are still populated with the data previously entered. I have read in WA's Forums that WA's Logout behavior is actually a Destroy Session behavior, but if it is so, how come those fields are still populated when another user logs in?

The Insert page has a validation behavior and all the Insert fields use WA_Validated Entries each, which may be the reason that the fields are still populated. But if the user already logged out (destroyed the session), why are those fields not empty after a fresh Login?

I have tried to destroy the session using the following code in the Index page but I get error messages when the user goes again to the insert page:

// remove all session variables
session_unset();

// destroy the session
session_destroy();

Any suggestions on how to delete all the data entered previously? Either on Logout or on the Index page?

Thank you for your attention

Sign in to reply to this post

Ray BorduinWebAssist

What is the error you are getting on the insert page? Those lines should clear the session. Probably one or the other would work, but it shouldn't cause issues to use both. I think the issue is correcting the error on the insert page, so if you provide that I may be able to help.

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

salaroche

Ray:

Attached please find the following:

1) the Insert page, 2) the error page that has the Logout ("No") button and 3) the Index page. -- #2 is the page that opens when validation fails on the Insert page.

Apologies if it looks a bit messy, but I'm in the process of building this site and I'm having some problems with the validation behavior on the Insert page. I will open another thread for that issue.

Thank you for your attention

Attached Files
FailedValidationMessage.php
Index.php
pslip_Insert.php
Sign in to reply to this post

Ray BorduinWebAssist

Sorry I don't know what I'm looking for. What is the exact error that you get?

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

salaroche

Ray:

The problem is the following:

When validation fails on the Insert page, users are redirected to the FailedValidationPage, and when users click on the "No" button in that page they are sent back to the Index page. That "No" button is supposed to activate the Logout behavior, but when the user Logs in again and goes to the insert page, the fields in the Insert page are still populated with the data previously entered. In other words, the Logout Behavior is not terminating the Session.

Thank you for your attention

Sign in to reply to this post

Ray BorduinWebAssist

Can I see a copy of the SecondPSMessage page... I want to see the code that clears the session.

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

salaroche

Sure. Here it is.

Attached Files
SecondPSMessage.php
Sign in to reply to this post

Ray BorduinWebAssist

The code just removes the login session variables... to remove the entire session add this to line 22:

session_destroy();

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

salaroche

Ray:

Excellent. So simple yet so right.

Many thanks.

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