Icon Menu: Log Out?

All WYSIWYG Web Builder support issues that are not covered in the forums below.
Forum rules
IMPORTANT NOTE!!

DO YOU HAVE A QUESTION OR PROBLEM AND WANT QUICK HELP?
THEN PLEASE SHARE A "DEMO" PROJECT.



PLEASE READ THE FORUM RULES BEFORE YOU POST:
http://www.wysiwygwebbuilder.com/forum/viewtopic.php?f=12&t=1901

MUST READ:
http://www.wysiwygwebbuilder.com/getting_started.html
WYSIWYG Web Builder FAQ
Post Reply
User avatar
AliGW
 
 
Posts: 589
Joined: Thu Dec 19, 2024 3:41 pm

Icon Menu: Log Out?

Post by AliGW »

I have an icon menu that has a link to the login page for my members' only area. In the members' only area, there is going to be a matching menu to navigate the secure area. Where on the main site's menu I have the Log In option, I'd like to have Log Out in the members' area. Is it possible to add the logout script to a menu button?

https://www.eastipswichcameraclub.co.uk/
Ali
Retired, but still loving to learn & very busy.
https://alisongwright.me.uk
Novice with WWB, but was an avid user of Serif WebPlus before.
Fairly expert at Microsoft Excel (but not VBA) & Affinity by Canva (for page layout).
User avatar
Pablo
 
Posts: 24630
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Icon Menu: Log Out?

Post by Pablo »

What you can do is link a dedicated logout page, where you add this script at the start of the page.

Code: Select all

<?php
session_start();
unset($_SESSION['username']);
unset($_SESSION['fullname']);
unset($_SESSION['role']);
?>
User avatar
AliGW
 
 
Posts: 589
Joined: Thu Dec 19, 2024 3:41 pm

Re: Icon Menu: Log Out?

Post by AliGW »

So an empty page with just that code? And do I set that to divert immediately to the index page?
Ali
Retired, but still loving to learn & very busy.
https://alisongwright.me.uk
Novice with WWB, but was an avid user of Serif WebPlus before.
Fairly expert at Microsoft Excel (but not VBA) & Affinity by Canva (for page layout).
User avatar
AliGW
 
 
Posts: 589
Joined: Thu Dec 19, 2024 3:41 pm

Re: Icon Menu: Log Out?

Post by AliGW »

This works well, however the LoginInfo object still shows me as logged in. Is there something else that we need to do to reset that?

Thanks.
Ali
Retired, but still loving to learn & very busy.
https://alisongwright.me.uk
Novice with WWB, but was an avid user of Serif WebPlus before.
Fairly expert at Microsoft Excel (but not VBA) & Affinity by Canva (for page layout).
User avatar
Pablo
 
Posts: 24630
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Icon Menu: Log Out?

Post by Pablo »

And do I set that to divert immediately to the index page?
You can use the 'redirect' option in the page properties or use code like this:

Code: Select all

<?php
session_start();
unset($_SESSION['username']);
unset($_SESSION['fullname']);
unset($_SESSION['role']);
header('Location: ./index.html');
exit;
?>
Once you are on a different page, the username value should no longer be valid.
User avatar
AliGW
 
 
Posts: 589
Joined: Thu Dec 19, 2024 3:41 pm

Re: Icon Menu: Log Out?

Post by AliGW »

Yes - as I said, I have that working.

What about the issue with the LoginInfo object still showing me as logged in?

I log out of the members' area and am taken back to the index page - works nicely.
Then I go back to the login page.
Expected: my logininfo object will not show because I am now logged out.
Observed: the logininfo object still shows, even though I am a logged out user.
Ali
Retired, but still loving to learn & very busy.
https://alisongwright.me.uk
Novice with WWB, but was an avid user of Serif WebPlus before.
Fairly expert at Microsoft Excel (but not VBA) & Affinity by Canva (for page layout).
User avatar
Pablo
 
Posts: 24630
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Icon Menu: Log Out?

Post by Pablo »

Once you are on a different page, the username value should no longer be valid.
It is still shows, then the session variables have not been reset.
User avatar
AliGW
 
 
Posts: 589
Joined: Thu Dec 19, 2024 3:41 pm

Re: Icon Menu: Log Out?

Post by AliGW »

I’ll try clearing cookies again and retest.
Ali
Retired, but still loving to learn & very busy.
https://alisongwright.me.uk
Novice with WWB, but was an avid user of Serif WebPlus before.
Fairly expert at Microsoft Excel (but not VBA) & Affinity by Canva (for page layout).
User avatar
AliGW
 
 
Posts: 589
Joined: Thu Dec 19, 2024 3:41 pm

Re: Icon Menu: Log Out?

Post by AliGW »

It is still happening, so session cookies are not being cleared. What can I do? It isn't actually logging me out at all.
Ali
Retired, but still loving to learn & very busy.
https://alisongwright.me.uk
Novice with WWB, but was an avid user of Serif WebPlus before.
Fairly expert at Microsoft Excel (but not VBA) & Affinity by Canva (for page layout).
User avatar
Pablo
 
Posts: 24630
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Icon Menu: Log Out?

Post by Pablo »

Did you add the code at the very top of the page?
User avatar
AliGW
 
 
Posts: 589
Joined: Thu Dec 19, 2024 3:41 pm

Re: Icon Menu: Log Out?

Post by AliGW »

I converted the object to a form. The code is at the very top of the page, yes. I haven't done anything to it. There is no other PHP code on the page.

Do you want a temporary login so you can see the issue?
Ali
Retired, but still loving to learn & very busy.
https://alisongwright.me.uk
Novice with WWB, but was an avid user of Serif WebPlus before.
Fairly expert at Microsoft Excel (but not VBA) & Affinity by Canva (for page layout).
Post Reply