PHP URL Redirection session

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
3jcrup
New php-forum User
New php-forum User
Posts: 1
Joined: Sun Jun 11, 2017 8:27 pm

Sun Jun 18, 2017 10:47 pm

hello guys, just starting PHP and please bear with this newbie question.

After a user login, I redirect the user to another URL or another PHP page if the login is successful.

If the user bookmark the URL so next time he will just click on the bookmark, this will bypass the login page.

How to check if the user is logged in or has an active session in when the URL is entered directly?

Example:
localhost/login.php
--login success redirect to
localhost/dataentry.php (web page will show invalid if ever user has no active session or has not been authenticated)

So how to verify if the user has an active session on the PHP page? Do I need a third party framework on this? Or PHP can handle it?

I'm using WAMP.

Thanks for any ideas.

chorn
php-forum Active User
php-forum Active User
Posts: 323
Joined: Fri Apr 01, 2016 2:18 am

Mon Jun 19, 2017 3:01 am

just check the login on the second page and redirect to login if not set.

Post Reply
  • Information
  • Who is online

    Users browsing this forum: Bing [Bot] and 8 guests