Page 1 of 1
Is this login possible?
Posted: Mon Apr 19, 2004 11:42 am
by yosuke_
OK, Im making login form,I have a idea about how to login, but Im not sure if its posible!! I dont want to use cookies so this is hot it wiull work:
User will login into mysite and if username and password will be corect then hes IP will be loged in. I know its sounds stupid but listen. I will have some extra rows in my database like
Loged in and
IP loged and when user will login hes IP will be added to
IP loged row and in
Loged in row will be added value
True and it works like this!!
When someone will try to login from other computer to some users accout, if user will be loged in and
Loged in row value will be
True then someone will not be able to login, becase there are allready user loged in!! Another thing if user will close broser and open it again then he will be loged in because script will check for IP with what user is logged in. And when he will click logoff, the script will update information in
Loged in field to
false. I know it souds stupid but how can I make users login, logoff and remember users without cookies?? is there any onther login way?? please help me!! im too stipid for this!!!

Posted: Mon Apr 19, 2004 11:45 am
by JayBird
This is the 4th time i have told you to post in the correct forum.
I won't be telling you again!
Mark
Re: Is this login possible?
Posted: Mon Apr 19, 2004 12:45 pm
by malcolmboston
yosuke_ wrote:OK, Im making login form,I have a idea about how to login, but Im not sure if its posible!! I dont want to use cookies so this is hot it wiull work:
User will login into mysite and if username and password will be corect then hes IP will be loged in. I know its sounds stupid but listen. I will have some extra rows in my database like
Loged in and
IP loged and when user will login hes IP will be added to
IP loged row and in
Loged in row will be added value
True and it works like this!!
When someone will try to login from other computer to some users accout, if user will be loged in and
Loged in row value will be
True then someone will not be able to login, becase there are allready user loged in!! Another thing if user will close broser and open it again then he will be loged in because script will check for IP with what user is logged in. And when he will click logoff, the script will update information in
Loged in field to
false. I know it souds stupid but how can I make users login, logoff and remember users without cookies?? is there any onther login way?? please help me!! im too stipid for this!!!

i asked pretty much the same question a while ago (in the correct forums)
anyway common pitfalls:
1 - what if a user doesnt click logout and closes the browser??? he wont be able to login ever again, you will need to find your own way of doing this im not writing the code out for you
[hint]
timed queries for updating records
[/hint]
its really easy.....
Posted: Mon Apr 19, 2004 1:01 pm
by yosuke_
Well, the user wont have to login again from the same computer, if thay didnt click logoff, but the problem is this: if user will use some internet caffe and then forgets to logout there will br problems and another problem is if the forgets to logout from safee PC and goes home, he wont be able to login from hes home PC, because he didnt logout from the caffe PC! And your hint meants? Automatic logoff after some time? or it can be logoof after sesson end!! And Im soo sorry about posting this in the wrong forum! I have to post this in code snipets right? thank you!
Posted: Mon Apr 19, 2004 1:05 pm
by malcolmboston
no, theory and design, you have provided no code so it shouldnt be in this forum
you wrote:
And your hint meants? Automatic logoff after some time? or it can be logoof after sesson end!!
try different ways like i said, im not writing it out for you, i get paid for doing that
Posted: Mon Apr 19, 2004 1:06 pm
by magicrobotmonkey
Don't forget most ISPs have dynamic IP's (At least in the US) so even the home computers IP can change! That's why I don't think using the IP like this is generall a very good idea... I mean I could see its use if you are setting up something in an Intranet where different departments were subnetworked or something but out on the net it worries me...
Posted: Mon Apr 19, 2004 1:10 pm
by JAM
The automatic logoff hint means...
Say you have a timestamp field in the database. Each time I do something on any page, this field is updated with the current timestamp (you can use time() och MySQL's NOW(), or whatever your flavour might be).
The script also does a:
Code: Select all
DELETE from TABLE where timestampfield <= NOW()-500
(needs rewriting, just pseudo code)
Hence, if I don't log off properly, the above sql query automaticly deletes all records where the timestamp is less than the current one minus 500 seconds.
So if I get home after 500 seconds, I'd be able to log in once again.
Do some searches for "useronline" in this forum and
http://www.evilwalrus.com/ for more ideas.
Posted: Mon Apr 19, 2004 1:11 pm
by yosuke_
The all progblems is with Opera Webbrowser!!! Cookie login/logoff works perfect with IE but when I try to use Opera it hase to be refreshed after logoff and dosnt work sometimes!!! Can you give me tips about how to make login/logoff without cookies?? I dont need no code snippets i just need some tips!! Im a newbie in web programming, so I dont know much about this!! thank you
Posted: Mon Apr 19, 2004 1:21 pm
by liljester
this doesnt sound like a very good login scheme... have you tried sessions in opera?
dont get me wrong, you should log who tries to login from what ip, but its not a good way to maintain user state (logged in or not).
Posted: Mon Apr 19, 2004 1:27 pm
by yosuke_
OK, I fill readly dumb!! I know what is global.asa in asp but I have no idea how to use sesons in PHP!!! Sorry
Posted: Mon Apr 19, 2004 1:35 pm
by liljester
have a look at the sessions tutorial, that may be the route you want to take =)
viewtopic.php?t=6521
Posted: Mon Apr 19, 2004 1:38 pm
by yosuke_
Thank you very much!!