security - How to secure my PHP site using sessions? -


I am trying to understand a good method to protect my site from attack. I am currently using cookies method. However, after some web research, I think it is not good to use cookies for security reasons, so my second option would be to use the session.

I read this article. In response to Anurag Jain, it has been said that the site should use https and it will not happen that the session ID should not be sniffed.

But there are some things that I do not understand.

When a user logs in to the site. I will run a query to check if the credential matches the user name and password. Then I store some information in different sessions (such as USER_ID, FULL_USER_NAME, TEAM_NAME, ACCESS_LEVEL)

After logging in and after a session is created, I can create session_id () after the session session begins I am After that I can save the session with an IP address in a database table. But after this how do I check the security every time to ensure that this user is actually created session and not a hacker?

How can this site be kept safe, "If session ID is enabled to repeat the same IP address then can not the attacker use it to enter the entry? Besides this How can I work if I want that many users "same network - same external IP address" from the same office

An article that I Many information was obtained.

Cookies will not be protected to use.

USER_ID, FULL_USER_NAME in the shop, not in session, not in the database. Therefore, when the connection is lost to the user, remove all sessions And a hacker can not use them.

The session is stored on the basis of connection and not the IP. < / Div>

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -