944,103 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 521
  • PHP RSS
Oct 13th, 2009
0

automatic log out. stop it!

Expand Post »
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
PHP Syntax (Toggle Plain Text)
  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.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
dourvas is offline Offline
20 posts
since Dec 2008
Oct 13th, 2009
1
Re: automatic log out. stop it!
Sponsor
Featured Poster
Reputation Points: 556
Solved Threads: 733
Bite my shiny metal ass!
pritaeas is offline Offline
4,203 posts
since Jul 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: session problem...
Next Thread in PHP Forum Timeline: How to force web page to open in internet explorer





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC