Troubleshooting users logged out when downloading invoices
Symptom
When a user attempts to download an copy of the PDF invoice via the client area, they are logged out and presented with the client area login page.
![Invoice Download Button](https://media.screensteps.com/image_assets/assets/004/243/924/original/28789469-cbbd-4515-a2f8-3ca363c52c50.png)
Cause
A peculiarity in pdo_mysql clients in certain server stacks causes unexpected behaviour in PHP. This is been observed more commonly on servers running CloudLinux.
Solution
Switching to the PHP native pdo_mysql driver resolves the issue and causes PHP to behave in the expected manner.
For systems operating in CloudLinux, the change can be made as follows:
1. Access the CloudLinux PHP Configuration interface on your server
2. Deselect the pdo_mysql option
3. Select the nd_pdo_mysql option:
![CloudLinux PHP Options screen showing nd_pdo_mysql](https://media.screensteps.com/image_assets/assets/004/243/922/original/821eb51c-f205-49ff-adc8-3a33fca2c89f.png)
The change should be immediately applied, and the download issue in WHMCS resolved.
For other server stacks, please consult with your server admin/hosting provider to recompile PHP with the native driver.