Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

"Advanced" login system - PLEASE HELP!

Featured Replies

Hello,

 

I'm working on this website, with some videos, and i would like to have a login system, to give my visitors the ability to rate and comment the videos. I'm not very familiar with login systems, and that's why i'm trying my luck here. My big problem is remembering if the user is logged in or not. I've created a simple login, with a form and when you press login, it will run a php script and connect to a database and check if the username is correct. If it is then it will redirect to a login page, and else it will redirect to wronglogin. As i said then i dont think the problem is the login part, but if i login to the website, and then lets say i click on a link in the menu, then i would have to login again?

 

How can i check if the user has logged in, even when i go to other pages on the website?

 

I've searched the internet, and some say i have to use cookies, with the entered password and username, and then check on every page if the cookie password and username is == to the username and password in the database? This might work, but i dont believe this is the best way of doing it?

 

Another solution i found was using php sessions, but i dont know anything about php sessions or cookies, so if the best solution is one of these too, then i would love to know which is better and maybe get some help!

 

Maybe if none of them, then i ofcause would love some help anyways!! :)

 

-Tobias

Hello,

 

I'm working on this website, with some videos, and i would like to have a login system, to give my visitors the ability to rate and comment the videos. I'm not very familiar with login systems, and that's why i'm trying my luck here. My big problem is remembering if the user is logged in or not. I've created a simple login, with a form and when you press login, it will run a php script and connect to a database and check if the username is correct. If it is then it will redirect to a login page, and else it will redirect to wronglogin. As i said then i dont think the problem is the login part, but if i login to the website, and then lets say i click on a link in the menu, then i would have to login again?

 

How can i check if the user has logged in, even when i go to other pages on the website?

 

I've searched the internet, and some say i have to use cookies, with the entered password and username, and then check on every page if the cookie password and username is == to the username and password in the database? This might work, but i dont believe this is the best way of doing it?

 

Another solution i found was using php sessions, but i dont know anything about php sessions or cookies, so if the best solution is one of these too, then i would love to know which is better and maybe get some help!

 

Maybe if none of them, then i ofcause would love some help anyways!! :)

 

-Tobias

 

You need to take a look at sessions and cookies in php

if the best solution is one of these too, then i would love to know which is better
Generally, cookies are easier to program, can last longer and require less work of the server; sessions are more secure and allow you to store more data so your requirements will determine whether you use sessions or cookies but you will have to use one of them.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.