Hi all,

I have a question regarding PHP login systems. Is it possible to have a login system within another login system.

Here's an example: I login to a site and PHP creates the session. I then want to access another page with some higher-secure content so I ask the user to re-type their username/password to gain access to that page.

Can this be done using different sessions or the same session? it would be great if the original session is not ended so once the user finishes on the page with the higher-secure content they can continue to use the previous pages.

Hope this makes sense, any information which could possibly point me in the right direction would be greatly appreciated! :)

Recommended Answers

All 2 Replies

You can maintain 2 different sessions for user

session one : logged in user $_SESSION = $logged_user_id;

session two : Higher security logged in user $_SESSION = $secure_logged_user_id;

so when you have both the sections with you, you can manage all the other pages with session1 variable. when ever it comes to higher secure page, you can check the data with higher secured session data.

Also you can check everytime session1 is equal to session 2 or not if necessary.

Hi all,

I have a question regarding PHP login systems. Is it possible to have a login system within another login system.

Here's an example: I login to a site and PHP creates the session. I then want to access another page with some higher-secure content so I ask the user to re-type their username/password to gain access to that page.

Can this be done using different sessions or the same session? it would be great if the original session is not ended so once the user finishes on the page with the higher-secure content they can continue to use the previous pages.

Hope this makes sense, any information which could possibly point me in the right direction would be greatly appreciated! :)

why you don't grant privileges to your users by adding more column to the user table to save their level [from 1 to what ever]and on each page you check the logged user level with the required to this page.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.