What are the differences between storing information in cookies versus sessions in PHP, and how does it affect cross-system communication?
Storing information in cookies involves saving data on the client's browser, while sessions store data on the server. Cookies are limited in size and can be manipulated by the client, making them less secure. Sessions are more secure and can store larger amounts of data. Cross-system communication can be affected by the choice between cookies and sessions as cookies are more easily accessible across different systems, while sessions are limited to the server where they are stored.
```php
// Using sessions for storing information
session_start();
$_SESSION['username'] = 'JohnDoe';
$_SESSION['email'] = 'johndoe@example.com';
```
This code snippet demonstrates how to store information in sessions in PHP.