user recognition

  • iochinome
  • Beginner
  • Beginner
  • iochinome
  • Posts: 42

Post 3+ Months Ago

hey guys, so i am making a pseudo social networking site for me and my friends, and so i did the whole username thing that countless others have done. the problem i am having is that i recognize the different users as being logged on my inserting their ip adress into a mysql row containing all of their information when they log in, then when they go to another page, i test which username has an ip that matches that of their computer, and assigns them that username and stuff- when we try to do this anywhere that computers all share an external ip address, it gets all screwed up. is there any way that i can see the internal ip adress or something? thanks guys.
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23456
  • Loc: Woodbridge VA

Post 3+ Months Ago

research using sessions and cookies.

http://www.google.com/search?hl=en&q=us ... gle+Search
  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8399
  • Loc: USA

Post 3+ Months Ago

For logins, I suggest SESSIONS as sessions are a server side way of doing it and COOKIES are a client way. If it's on client side, than the information is on client's computer and that means the client can change that information.

SESSIONS on the other side is server side and the clients can't change them. So the information is safe and the clients can't change anything.
  • spork
  • Brewmaster
  • Silver Member
  • User avatar
  • Posts: 6252
  • Loc: Seattle, WA

Post 3+ Months Ago

Huh?

PHP.net wrote:
A visitor accessing your web site is assigned a unique id, the so-called session id. This is either stored in a cookie on the user side or is propagated in the URL.
  • iochinome
  • Beginner
  • Beginner
  • iochinome
  • Posts: 42

Post 3+ Months Ago

okay, so i read a couple tutorials. on the ones i went to, it seemed not to be fazed by the whole ip adress thing- it would just store the username you were logged in as in a session, then check that up against a sql database when you got to a new page. will this work on really big networks where two people under the same external ip are on the site at the same time (i.e. is the session id or whatever the same for them, does the server recognize them as unique individuals), or do i have to dick around with cookies? thanks
  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8399
  • Loc: USA

Post 3+ Months Ago

Why do you want IP checking? I don't see any purpose in it. What are you trying to do with the IP?
  • iochinome
  • Beginner
  • Beginner
  • iochinome
  • Posts: 42

Post 3+ Months Ago

okay i realized while i was gone that i didnt really need the ip address now that i am using sessions. thanks though.
  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8399
  • Loc: USA

Post 3+ Months Ago

No problem... so the problem is fixed?
  • iochinome
  • Beginner
  • Beginner
  • iochinome
  • Posts: 42

Post 3+ Months Ago

okay, so not quite. im pretty sure i did all the sessions right, it seems that they are turned off or something. is there a process to allow sessions? thanks
  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8399
  • Loc: USA

Post 3+ Months Ago

Do you have session_start(); at the very top of each page that has $_SESSION['session_name']; on? At the very top... like the first... before the doctype and everything... Even at log-in and at log-off...
  • iochinome
  • Beginner
  • Beginner
  • iochinome
  • Posts: 42

Post 3+ Months Ago

oh i did not realize that it had to be at the beginning of every page... thats pretty counter intuituve, since you are not starting a new session... well thankyou very much. i will test this.

Post Information

  • Total Posts in this topic: 11 posts
  • Users browsing this forum: No registered users and 86 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.