close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

User Authentication - log in and log out

Thread began 12/27/2015 11:00 am by dazler1977 | Last modified 1/04/2016 8:51 am by Ray Borduin | 825 views | 5 replies |

dazler1977

User Authentication - log in and log out

The tutorials are not helping and I am in need of help. I do not understand this mysqli server behavior, even though I have used the deprecated server behavior and that was a lot more easier.

1. I have the login but I need to set it with the users being directed to 2 different pages. On my registration form the users choose which type of user they are. One would be a candidate and the other is a company. How do I set this?

2. The logout button does not clear my sessions. I created a logout page. Am I suppose to include session start on all pages including the logout.

Please help...

Sign in to reply to this post

Ray BorduinWebAssist

If you include sample pages I can see what you did wrong.

In terms of having two redirects you may what to apply the login server behavior twice and include a column filter for the user type column where you store whether they are candidates or companies.

Just apply it twice and don't include a failure redirect in the first one, but have a success redirect in both.

The logout server behavior should include the session_start code automatically. You only have to manually add it when referring to session variables from another server behavior on the page. All of the user authentication server behaviors should start the session automatically.

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

dazler1977

User Authentication - log in and log out

I got the page to redirect to 2 different pages based off the login chosen. Thank you. As for the logout, it does log out but when I right click on the page and choose inspect, under the cookies it shows that the phpsessionid is active. How do I go about making sure that all the sessions are removed, also it adds a session if I put the incorrect password in when a user logs in. It doesn't log in the user it just adds the phpsessionid.

Any help will be appreciated.

Sign in to reply to this post

Ray BorduinWebAssist

You can remove all other session variables by adding code to you logout page like:

php:
<?php

@session_start();
session_destroy();
?>
Sign in to reply to this post
Did this help? Tips are appreciated...

dazler1977

User Authentication - log in and log out

I am not sure if I am doing this correctly. The phpsession is still there. I have attached my code that is on my logout page. Where would I put it? I added the code at the top and that didn't work. I even added below the logout section and that still didn't work.

Sign in to reply to this post

Ray BorduinWebAssist

You can add it right below the other logout code:

php:
<?php require_once('../webassist/mysqli/authentication.php'); ?>

<?php
if ("" == "") {
  
$LogOut = new WA_MySQLi_Auth();
  
$LogOut->Action "logout";
  
$LogOut->Name "signin";
  
$LogOut->execute();
}

@
session_start();
session_destroy();
?>

<?php include("../partials/header.php"); ?>
<div class="full-content">
    
    <div class="logout">
Sign in to reply to this post
Did this help? Tips are appreciated...

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