Jump to content


Photo

Php Session Issues


  • Please log in to reply
2 replies to this topic

#1 rajnair0278

rajnair0278
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 15 April 2006 - 07:00 AM

Hello folks, this is my first post and relatively new to PHP also. I am facing some real session issues. Will explain in detail: I have a main webpage that opens up in a new browser window. The webpage has several frames that opens up different .php files. The frames refresh after every fix duration. So the main page never refreshes completely. I have a session set on it. All is fine.

Now when a user logs in with the same username and password on machine 2 as machine 1 the user on machine 1 should not be able to browse further. His session should expire. Something that you so often see on yahoo mail site. Got my point??

Do leme know if you need anyother information. The site is hosted on Linux 9 and Mysql is the database. Any help will be appreciated. Thx in advance. Cheers!!

#2 Vinze

Vinze
  • Members
  • PipPipPip
  • Advanced Member
  • 80 posts

Posted 15 April 2006 - 10:07 AM

What exactly is your problem?

If you want a session to expire, you could e.g. let a logged in user send some information to a database, unless that information is already in the database in which case you could do an unset($_SESSION) or a session_destroy().
WTH? I became a guru by asking questions!

#3 GingerRobot

GingerRobot
  • Staff Alumni
  • Advanced Member
  • 4,086 posts
  • LocationUK

Posted 16 April 2006 - 08:23 AM

So you want to log someone out if they log in on a differant machine?

I would guess the only way of doing this would be to record the IP used to log in, and on each refresh of the frame check if the current IP being used is the same as the last logged in IP. If its not, log them out.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users