How to create token like phpmyadmin?

I want to know how phpmyadmin does, create token in all pages and form. And many other big website also to do that.

Now, please give me a solution/tutorial corresponding above ?

Thank.