Multiple Sessions

Codes here !

Moderators: egami, macek, gesf

Post Reply
User avatar
Nullsig
php-forum Fan User
php-forum Fan User
Posts: 979
Joined: Thu Feb 17, 2011 6:52 am
Location: Racine, WI

Fri May 04, 2012 5:49 am

Why don't you have it so that the "Patient Session" is just built into the "Doctor Session"

Doctor Logs in to practice causing associated SESSION variables to be set. Then patient logs further into the system to access their personal records causing other SESSION variables to be set.

Once patient is done they log out of the system so that their information isn't accessible to others. You could also build in a 10minute timeout of the Patient level session variables so that if they forget they are still covered.

User avatar
freshnet
php-forum Active User
php-forum Active User
Posts: 359
Joined: Tue Feb 22, 2011 8:19 am
Location: Canada

Sun May 06, 2012 11:03 am

I'm not clear why you'd need both to be logged in at the same time, could you clarify a little what the page is supposed to do exactly?

User avatar
macek
php-forum Active User
php-forum Active User
Posts: 277
Joined: Wed Aug 25, 2010 10:42 am
Contact:

Mon May 07, 2012 1:46 am

I think you don't know what the SESSION is and how it works :-)

It is per user / per PC / per CONNECTION variable. If I connect to your page I get some SESSION, if you load your page you get another SESSION.

So you only need one table with users (doctors and patients), table could be:

id | login | password | role (doctor/patient)

you will check login credentials posted by the form and then do

IF you are DOCTOR you cat do THIS
IF you are PATIENT you can do THAT

Understand?

User avatar
freshnet
php-forum Active User
php-forum Active User
Posts: 359
Joined: Tue Feb 22, 2011 8:19 am
Location: Canada

Mon May 07, 2012 2:23 am

agreed, it sounds like you don't need sessions for this use case at all.

You don't really need to have another table either, you can use one table and have something like a 'doctor_flag' in the table. If that's set to 'true', the person can see all the records a doctor would see. Let me know if you need any help with the database design ;)

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 2 guests