define() security?

Discussion in 'PHP' started by splatcatballa99, Sep 19, 2007.

  1. #1
    Alright so heres the breakdown.

    A user logs in and i set 2 cookies username and password then at the top of every page i check if the password cookie matches the password in the db which matches to the username. If it it does i define() LOGGED to be 2 telling me there logged in.

    But I was thinking and wondering these things?
    • Is define stored locally on each user's computer or is it a site wide thing?
    • can i define the same thing like STATUS different for each user like for me make it active but another user make it away and have this all at the same time?
     
    splatcatballa99, Sep 19, 2007 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #2
    Constants are stored in the server's memory, and are more secure than variables because they can't be overwritten.

    And I don't understand the second question.

    However, as for your cookies, I don't suggest storing the password in it (Unless it's encrypted). But I would suggest using sessions, as the security and compatibility is higher.
     
    nico_swd, Sep 19, 2007 IP
  3. splatcatballa99

    splatcatballa99 Well-Known Member

    Messages:
    400
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    130
    Digital Goods:
    1
    #3
    ok thanks :)
     
    splatcatballa99, Sep 19, 2007 IP