As we know that the PHP session ids are saved in Cookies. To make a cookie available in all the sub-domains, we need to assign it to the root domain. Then all the sub-domains will get the session id from cookie and PHP can find the session using passed session id.
Tutorials
Useful Tips for Creating Secure PHP Applications
PHP is one of the most popular programming language for developing web projects. But like other scripting languages, PHP also has few security holes that can make our application insecure. In this tutorial, we will take a look at useful tips to help you avoid some common PHP security problems.
Working with php.ini file Configuration
Whether you’re novice or experienced PHP programmer, PHP.ini configuration is essential. It’s an important configuration file that is used to customize behavior of PHP at runtime. When PHP server starts up it looks for PHP.ini file first to load various values for settings. The php.ini file is where you can make changes to your PHP […]
Remove Repeated Words From String in PHP
Usually we do remove duplicate words from a text using array functions etc, but it’s quite slow doing that way because of the size of the text. The fastest way to achieve the same result is PHP regex. You can remove duplicate words using PHP regular expressions with preg_replace function. Also, read: Convert Associative Array […]
Converting a PHP Array to a Query String
We often need to convert a PHP array to a query string for use in a URL or POST request, and vice versa. Really, PHP is very rich with its build in functions as it has very useful function http_build_query() to convert a PHP array to a query string. Here in this post, I have an example […]