|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Currently, I am working on the Members Area, such as members login, the script will generate a sessionid for this member. And I am trying to create a script that can remember members info if a member checked the checkbox when he/she logged in the site, so that everytime he/she comes to the site he/she will be automately login. Could somebody help me with this? What steps I have to do? Greatly appreciated.
|
|
#2
|
|||
|
|||
|
What you have to do is set a cookie on the client's browser that is returned to you when they request a page. That way you can identify their SID.
Look here: http://www.onlamp.com/pub/a/php/excerpt/webdbapps_8/ |
|
#3
|
|||
|
|||
|
|
|
#4
|
|||
|
|||
|
I have no idea. You're better read more about cookies.
|
|
#5
|
|||
|
|||
|
Thanks for your help Avit. It is really hard for me to implement my code in to Ben's Article, because I designed my code different than Ben's Codes. Here is the brief login procedures that I have coded so far if anyone can help me I would greatly appreciate:
Quote:
From this point, I have no idea how to setup a check cookie and other steps in order the cookie to be recognized. Please someone help me with this. |
|
#6
|
|||
|
|||
|
PHP Code:
__________________
-- Jason Last edited by Taelo : April 23rd, 2003 at 01:42 AM. |
|
#7
|
|||
|
|||
|
Thank you very much Jason! But how can I use it? I have no clue with your code. Could you give a instruction? Thanks again.
|
|
#8
|
|||
|
|||
|
I edited and added comments,...let me know if it helps,..
![]() |
|
#9
|
|||
|
|||
|
Quote:
Back up a little for me too, Taelo... What's the id_hash ? Is that an md5() of the uid & pass? Do you store that using setcookie(), and then compare it to a stored hash in your database? |
|
#10
|
|||
|
|||
|
this can be anything,....... it can be an md5 password,... or md5 session id,..... anything really,...... the point is to have more then 1 cookie ID to authenticate against. that way it makes it harder for a user to "become" another user
![]() just make sure to that whatever you choose to set in the cookie, set it in the database as well ![]() |
|
#11
|
|||
|
|||
|
Thanks for your kind help, but I couldnot figure it out how to apply to the code which I currently have into yours. Could you please help if I sent you my codes. Greatly appreciated.
|
|
#12
|
|||
|
|||
|
the easiest way to do it,....is to throw my code into a function or put it into a file and include it on a page. just remember the steps you need to take
1.) check to see if any session vars exist 2.) check their cookie values against their database values 3.) if they match, reset this users session vars ohhh yeah, I am sure you already knew this, but you are going to have to change some things, well alot of things, if you want to use my code. I was just showing a flow and how I do it. |
|
#13
|
|||
|
|||
|
I give up. Cann't do it. Please help Taelo.
|
|
#14
|
|||
|
|||
|
hehehe,....post your login code,.....not the html form,...just the php.
|
|
#15
|
|||
|
|||
|
Yessss!!!! Finally, You accept to help me. Honestly, I was so disappointed that you was not gonna help me. Now, I am so happy
. You're my man.Here I have enclosed some parts of my code and how I designed. Please don't laugh about my code. I am just a newbie .I am willing to fix anything from database design to any parts of my project. Once again, thanks you so much for you help. |
|
#16
|
|||
|
|||
|
here are the pieces of your code you need to be concerened with PHP Code:
|