automatic log out. stop it!

Reply

Join Date: Dec 2008
Posts: 12
Reputation: dourvas is an unknown quantity at this point 
Solved Threads: 0
dourvas dourvas is offline Offline
Newbie Poster

automatic log out. stop it!

 
0
  #1
Oct 13th, 2009
hallo there,

i ve implemented a log in system which works just fine. i have a simple form username and psw and when the user pushes the button "ok" i check into mysql database if those names exists. if yes, i create a session and i keep some variables so i can use them later.
the code
  1. $qry="SELECT * FROM members WHERE login='$login' AND passwd='$password'";
  2.  
  3. $result=mysql_query($qry);
  4.  
  5. //Check whether the query was successful or not //////////////////////'".md5($_POST['password'])."'";
  6. if($result) {
  7. if(mysql_num_rows($result) == 1) {
  8. session_regenerate_id();
  9. session_register("authenticated");
  10. $member = mysql_fetch_assoc($result);
  11. $_SESSION['SESS_MEMBER_ID'] = $member['member_id'];
  12. $_SESSION['SESS_FIRST_NAME'] = $member['firstname'];
  13. $_SESSION['SESS_LAST_NAME'] = $member['lastname'];
  14. $_SESSION['SESS_CLASS'] = $member['class'];
  15. $_SESSION['SESS_FATHERSNAME'] = $member['fathersname'];
  16. session_write_close();

i had no problem at all till i realized it today.
when someone is logged in he should fill in some forms. this may take a while. if the user is too late doing that, i am not sure for how long, he can not sudmit the form because he is no longer logged in...... the system shows exception and errors.

what can i do so the user may stay longer logged in???
Last edited by dourvas; Oct 13th, 2009 at 5:28 am.
Reply With Quote Quick reply to this message  
Join Date: Jul 2006
Posts: 883
Reputation: pritaeas will become famous soon enough pritaeas will become famous soon enough 
Solved Threads: 142
Sponsor
pritaeas's Avatar
pritaeas pritaeas is offline Offline
Practically a Posting Shark
 
1
  #2
Oct 13th, 2009
"If it is NOT source, it is NOT software."
-- NASA
Reply With Quote Quick reply to this message  
Reply

Message:



Similar Threads
Other Threads in the PHP Forum
Thread Tools Search this Thread



Tag cloud for PHP
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC