Month: March 2017

Relation between sessions and cookies

A session is a set of data that is stored on the server, usually as key-value pairs. A session is assigned a pseudo-random, secret ID that is usually stored in the user’s browser using a cookie, for example SESSID=abcdef123456789. The session ID typically matches the name of a file containing the session data on the … Continue reading

final keyword in PHP

final keyword is used in PHP as final class and final method. A final class is one which cannot be extended. A final method cannot be overridden in extended class.

How to call non static method from static method in PHP?

If the instance of your class is rarely needed, you can have the static method create an instance, call the non-static method and return the value.

How to use two traits with duplicate method in PHP?

We can easily use multiple traits with duplicate method name with instance of like as follow

How to fix the intentionally vulnerable plugin?

How to fix the intentionally vulnerable plugin

Difference between primary key and unique key

Primary Key is used to identify a row (record) in a table, whereas Unique-key is to prevent duplicate values in a column (with the exception of a null entry). By default SQL-engine creates Clustered Index on primary-key if not exists and Non-Clustered Index on Unique-key. Primary key does not include Null values, whereas Unique-key can. … Continue reading