Hi.
I have a text database on my server.
When a user choose to log out,
1. His/her information remain on the database?
2. If the answer to the question 1 is YES, this means that I must delete this information by hand?
3. If the answer to the question 1 is NO, when or how it will be deleted?
I would wish the user information to be deleted automatically...
Is there some other choice?
Thank you.
Logout user from a text database
Forum rules
PLEASE READ THE FORUM RULES BEFORE YOU POST:
viewtopic.php?f=12&t=1901
MUST READ:
http://www.wysiwygwebbuilder.com/login_basics.html
http://www.wysiwygwebbuilder.com/login_tools.html
TIP:
A lot of information about the login tools can be found in the help/manual.
Also checkout the demo template that is include with the software.
PLEASE READ THE FORUM RULES BEFORE YOU POST:
viewtopic.php?f=12&t=1901
MUST READ:
http://www.wysiwygwebbuilder.com/login_basics.html
http://www.wysiwygwebbuilder.com/login_tools.html
TIP:
A lot of information about the login tools can be found in the help/manual.
Also checkout the demo template that is include with the software.
Re: Logout user from a text database
Yes1. His/her information remain on the database?
No. Why?2. If the answer to the question 1 is YES, this means that I must delete this information by hand?
The login state will not be stored in the database, only the username/password.3. If the answer to the question 1 is NO, when or how it will be deleted?
The login session will end as soon as the user closes the browser or when the timeout expires.
https://www.w3schools.com/php/php_sessions.asp
Re: Logout user from a text database
Thank you, Pablo.
This means (if I understand well) that when the user closes the browser and he open it again, he will cannot login with the same username and password?The login session will end as soon as the user closes the browser or when the timeout expires.
Re: Logout user from a text database
.Yes he can; since the username /password remains unchanged even if he closed the browser. See Pablo's answer below:This means (if I understand well) that when the user closes the browser and he open it again, he will cannot login with the same username and password?
The login state will not be stored in the database, only the username/password.
Re: Logout user from a text database
I understand what you write, but I cannot find the solution to the problem.
Probably I I have made something wrong.
All the web pages have the extension .php
The logout page is a protected (with the lock) web page with the logout button?
Is it correct?
On the Object properties > Logout of the logout button I made a "than you page": ./logout_thank_you.php
Is it correct?
In the Page HTML of the logout page (start of page) I read the following code:
Do you see something wrong here?
The login session will end as soon as the user closes the browser or when the timeout expires.
I have read https://www.w3schools.com/php/php_sessions.asp, but I cannot understand whether I must change something on my page:
Last night I created a user (sign up) on my computer. I used logout. But today I can login with the same username and password.
Probably I I have made something wrong.
All the web pages have the extension .php
The logout page is a protected (with the lock) web page with the logout button?
Is it correct?
On the Object properties > Logout of the logout button I made a "than you page": ./logout_thank_you.php
Is it correct?
In the Page HTML of the logout page (start of page) I read the following code:
Code: Select all
<?php
if (session_id() == "")
{
session_start();
}
if (!isset($_SESSION['username']))
{
header('Location: #');
exit;
}
if (isset($_SESSION['expires_by']))
{
$expires_by = intval($_SESSION['expires_by']);
if (time() < $expires_by)
{
$_SESSION['expires_by'] = time() + intval($_SESSION['expires_timeout']);
}
else
{
unset($_SESSION['username']);
unset($_SESSION['expires_by']);
unset($_SESSION['expires_timeout']);
header('Location: #');
exit;
}
}
if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['form_name']) && $_POST['form_name'] == 'logoutform')
{
if (session_id() == "")
{
session_start();
}
unset($_SESSION['username']);
unset($_SESSION['fullname']);
header('Location: ./logout_thank_you.php');
exit;
}
?>
The login session will end as soon as the user closes the browser or when the timeout expires.
I have read https://www.w3schools.com/php/php_sessions.asp, but I cannot understand whether I must change something on my page:
Last night I created a user (sign up) on my computer. I used logout. But today I can login with the same username and password.
Re: Logout user from a text database
Correct. Nothing is wrong. This is how it works. Why would you need a different username/password?But today I can login with the same username and password.