Hai EveryOne,
My questions are very minor but since iam new to PHP iam not able to do.
Once the user enters login name and password the file where iam validating them
Iam starting a Session .Iam validating the login name and password in file 'validate.php'
The first line in this validate.php is session_start();
After a validating Iam registering the session with session_register("username");
But now iam going to change the code wat i have done earlier.
First Question:
I want to have all the userdetails in that session which should be accessable in all following pages.
Should i use 1. session_register("loginname","sessionID","userID");
or 2. session_register("loginnane"); session_register("sessionID"); session_register("userID");
Please say which one to use and also the way to unregister the session.
Wats the exact difference between session_unregister() and session_destroy()
Second Question:
How to check in each page whether the session is existing or not for the above?
I have to check for all the three variables or one variable?
Third Question:
How to set Session time out?
I know the function :
void session_set_cookie_params (int lifetime [, string path [, string domain]])
But no idea how to use?
What are lifetime ,path and domain?
Fourth Question:
I want to show persons online?
Iam storing the user details in once he logs in a 'login' table and displaying the same as ONLINE.
In logout iam deleting that record.
This wont work if the user has closed the browser with out logging out.
Iam updating in the database for each page access the present time.
I want to have a session time out for 20 minutes.
If any page access has not been done for 20 minutes i have to show him as offline
and should also delete from the 'login' table.
How to delete from login table if he is ideal for 20 minutes?
Is this good way to connect to database for every page access or any other way??
Fifth Question:
How to check in every page whether he is ideal for the last 20 minutes?
Thanks in Advance,
---Ajay