close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

MySQLi Log Out User not logging out user?

Thread began 8/03/2018 5:48 am by Nathon Jones Web Design | Last modified 8/08/2018 10:00 am by Ray Borduin | 2140 views | 10 replies |

Nathon Jones Web Design

MySQLi Log Out User not logging out user?

I have the following on a sign out page:

<?php require_once('webassist/mysqli/authentication.php'); ?>
<?php
if ("" == "") {
$LogOut = new WA_MySQLi_Auth();
$LogOut->Action = "logout";
$LogOut->Name = "prescIN";
$LogOut->execute();
}
?>



I have another page with the MySQLi Restrict Access to Page behaviour...

<?php require_once('webassist/mysqli/authentication.php'); ?>
<?php
if ("" == "") {
$RestrictAccess = new WA_MySQLi_Auth();
$RestrictAccess->Action = "restrict";
$RestrictAccess->Name = "prescIN";
$RestricAccessRedirect = "staff.php?f=2";
if (function_exists("rel2abs")) $RestricAccessRedirect = $RestricAccessRedirect?rel2abs($RestricAccessRedirect,dirname(__FILE__)):"";
$RestrictAccess->FailRedirect = $RestricAccessRedirect;
$RestrictAccess->execute();
}
?>



However, when we click our sign out button, and are taken to the sign out page, and then attempt to access the page that's restricted, it simply allows us access to that page.

Anything obvious in the above?
Thank you.
NJ

Sign in to reply to this post

Nathon Jones Web Design

It appears that this problem is completely related to the Auto-login Check and Remember-me Check functions in the MySQLi Log In User behaviour.
I created the Log In User behaviour again, without those functions, and it's now successfully logging out users.

I have a "Remember Me" check box on my sign in page, which I'd like to use, although I have noticed that the same Remember Me check box for this forum has never worked so my faith in this facility isn't 100%!

I assume, if someone checks the "Remember Me" check box on the sign in page then when they access the login page again it should automatically log them back in? Or just pre-fill the sign in form?

I'd appreciate some advice on how this feature is supposed to work as it's obviously not in the help files.

Thank you.
NJ

Sign in to reply to this post

Ray BorduinWebAssist

Remember Me should just put the username in the username field. Automatic Login should keep the user logged in at all times after their first log in... so log out would effectively do nothing.

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

Nathon Jones Web Design

How do I trigger the Remember Me to respond to the user checking a 'Remember Me' check box?

Automatic Login explains a lot about my previous issues! :S Is it automatically logging people in based on Session values?

Thanks Ray.
NJ

Sign in to reply to this post

Ray BorduinWebAssist

It automatically logs you in based on cookies set.

Remember Me also sets a cookie that you can then use to populate the text field.

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

Nathon Jones Web Design

So there's no need for a "Remember me" checkbox then, if the behaviour does that automatically?

Sign in to reply to this post

Ray BorduinWebAssist

The remember me checkbox initiates the saving of the username in the cookie and population of the text field from that cookie. The Auto Login saves both the username and passsword and uses the cookie directly to log the user in without ever displaying the form.

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

Nathon Jones Web Design

The behaviour wizard doesn't display an option for utilising a form field as the trigger. How do I create that in the Remember-me Check section of the wizard?

Thank you.
NJ

Sign in to reply to this post

Ray BorduinWebAssist

That is all automatically done by the wizard. What are you trying to do?

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

Nathon Jones Web Design

The sign in form I'm using is a Bootstrap 4 template which has a "Remember me" checkbox:
http://www.nathonjoneswebdesign.co.uk/dgprescribingsupport/staff.php

I'm using this with the MySQLi Log In User behaviour but I was unclear how the behaviour would automatically know the name of the Remember me check box (in order to establish if a user has checked the box or not).

Are you saying that the behaviour, if Remember-me Check is selected in the Wizard to be triggered, automatically remembers the username (via cookie) regardless of whether or not the user has checked the remember me box?

Sorry for my confusion (well documented!).
NJ

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