WEB how do you handle user login across multiple pages with php/apache/whatever?

Discussion in 'OT Technology' started by White Stormy, Jul 29, 2008.

  1. White Stormy

    White Stormy Take that, subspace!

    Joined:
    Sep 17, 2002
    Messages:
    85,489
    Likes Received:
    70
    Location:
    Sparkopolis
    if I put a login box on one page.. and just have it check a database for login success.. what do I do so that when the user goes to another page they remain logged in? :dunno:

    this is one of the last 2 things that I think I need to get a good grip on.

    thanks
     
  2. Limp_Brisket

    Limp_Brisket New Member

    Joined:
    Jan 2, 2006
    Messages:
    48,422
    Likes Received:
    0
    Location:
    Utah
  3. spahndirge

    spahndirge Scumbag Member

    Joined:
    Jul 15, 2005
    Messages:
    421
    Likes Received:
    0
    or give them a cookie :)

    Look at the setcookie function.

    A simple testing measure to make is to have an if statement on each logged in page, ie. if cookie exists, show the page, if not, redirect to login.

    Sessions expire when the user closes down the browser, session data is stored on the server and cookie data is stored on the users pc. There's a bit of a trde off between sessions and cookies, typically, cookies are used for logging into a site, sessions are used for shopping baskets.
     
  4. White Stormy

    White Stormy Take that, subspace!

    Joined:
    Sep 17, 2002
    Messages:
    85,489
    Likes Received:
    70
    Location:
    Sparkopolis
  5. White Stormy

    White Stormy Take that, subspace!

    Joined:
    Sep 17, 2002
    Messages:
    85,489
    Likes Received:
    70
    Location:
    Sparkopolis
    :love: thanks
     

Share This Page