Help needed on PHP session

Discussion in 'PHP' started by kks_krishna, Jul 7, 2007.

  1. #1
    HI,

    i want to implement session in my site. If for a particular page should be accesses by only the loged in user. so I need to check whether the user is logged in or I shoud forward to Registration page or login page.

    Once the user is logged in we can use the userid to log the activities. How can we do this?
     
    kks_krishna, Jul 7, 2007 IP
  2. hostcord

    hostcord Peon

    Messages:
    35
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
  3. MMJ

    MMJ Guest

    Messages:
    460
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #3
    When the user logs in put the username/pass into a session.

    Check them on every page.

    Redirect if not logged in.
     
    MMJ, Jul 7, 2007 IP
  4. ansi

    ansi Well-Known Member

    Messages:
    1,483
    Likes Received:
    65
    Best Answers:
    0
    Trophy Points:
    100
    #4
    and please don't store sensitive information in the session. query the database for it. keeps things secure that way :)
     
    ansi, Jul 7, 2007 IP