session handling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



hi all,

i'm a newbie and i really would like to be able to understand how session works.

for the scenario, i have customers with two users login to manage their records (like adding their own customers). e.g. customer A has a username customera1 and customera2,  customer B has customerb1 and customerb2.

when user logins, i add on the session accountcode $_SESSION['accountcode']  (which is the unique identifier for each customer). here are some of the questions i have:

1. how can i make sure each user can login only one time?
2. if customera1 and customera2 are logged in at the same time and they  are going to access the same data, how can i lock it to whoever had access to it first?
3. if a session expires, is there a way to automatically logout that user and destroy the session?
4. if both a user in customer A and B are logged in, then user A logouts and i have a script that call session_destroy(), will that also destroy the session of customer B?

hope someone can help me.

regards,
nhadie


       
---------------------------------
Be a better friend, newshound, and know-it-all with Yahoo! Mobile.  Try it now.

[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux