Has anyone ever wanted to put the logout button on the master page but it never works when you actually try?
Well then, follow these simple steps to work around this!
1. Create a new page and call it logoutprocess
2. MAKE SURE THE EXTENSION IS SET TO PHP!
3. Go to Page > Page HTML
4. Choose Start of Page
5. Enter this:
Code: Select all
<?php
if ($_SERVER['REQUEST_METHOD'] == 'POST')
{
session_start();
unset($_SESSION['username']);
header("Location: ./logoutsuccess.html");
}
?>
If some people want to go the extra mile like I have on my client area, you can make it so when someone logs out, it has a banner saying logging out.
To complete this:
1. Insert a layer that covers the whole page width and a height of about 80.
2. Open Properties for the Layer and enter in the Right box, 10.
3. Make sure there is a margin for the layer from the top and left of 10 pixels.
4. Go to the Layout properties of the Layer, choose a nice background colour and border.
5. Go to the coding in the Start of HTML and remove the header("Location: line
6. Go to Page Properties > Misc and enter a redirect page with about 3 - 5 second delay.
7. Put a text object in the center of the layer saying something like "You are being logged out"
8. Put a link in the text that says "Click if you are not redirected" so the user can click it if they are not redirected.
The finished piece should look like this:
I hope this helps people!