Showing posts with label best practices. Show all posts
Showing posts with label best practices. Show all posts

Friday, May 6, 2011

PHP - Session Security, Tips to keep the session secure

As Explained in earlier post about the PHP Session - Starting Session, Modifying Session and Deleting Session,session stores important information. Most of the times Session have very important information about the user. User data, like Id, username, and many more.
Session might also have the Shopping Cart information. All these information are very valuable and sensitive. So proper methods are need to implemented to keep the session secure.

Here are some of the ways you can keep your session safe.

  1. Use SSL when authenticating users or performing sensitive operations.
  2. Regenerate the session id whenever the security level changes (such as logging in). You can even regenerate the session id every request if you wish.
  3. Have sessions time out
  4. Don't use register globals

Saturday, April 16, 2011

10 Best PHP Coding Style Practices

One the major problem for the beginners is the STYLE OF CODING, as it was for me as well. For some of the first few months I was stuck with the standards of different Frameworks and was following them and extracting the best of their styles. But short after I felt that, although they all are very different from each other but they have something in common, their Coding patterns. 

Lets Start.
  1. First of all Choose your favorite IDE. There are lots of PHP IDE in the markte, like NetBeans, Eclipse, PHPEdit, and lots more, Just Google :). As per my favorite I user NetBeans.