Session Issue- Get The Solution!
The information about the user is stored on the server for later use in PHP session across the page requests. This includes login status, shopping items, etc. across the page requests. This session is stored on a temporary basis and as soon the user left the website, information will be deleted. OpenCart uses session on a lot of aspects like login status, product cart, compare, etc. In some of the cases, session issue will give an error message. But there is a time when it does not show any error message; to identify it, here is some evidence of session issue:
- Product in the cart is self-cleared.
- Product in the cart is cleared after user logged in.
- No items stored at product are compared.
- OpenCart admin always asking to log in and get the message “Invalid token session. Please login again”.
- Warning: session_start () [function.session-start]: open (/tmp/sess_41abirkdiesf9efwej46wtib2, O_RDWR) failed: No such file or directory (2) in /path/public_html/system /library /session.php on line 11
- Warning: session_start () [function.session-start]: open (/tmp/sess_41abirkdiesf9efwej46wtib2, O_RDWR) failed: Permission denied (13) in /path/public_html/system /library /session.php on line 11
- Warning: session_start() [function.session-start]: open(/tmp/sess_41abirkdiesf9efwej46wtib2, O_RDWR) failed: No space left on device (28) in /path/public_html/upload/system/library/session.php on line 11
- Open php.ini and add code below:
session.save_path = /tmp;
- If solution above not work, contact your host and ask them how to set session.save_path.
- “Permission denied”, ask your host to check the session directory permission.
- “No space left on device”, ask your host that, Is it server issue or you need to upgrade to larger hosting space?.
Allowed Memory Size Exhausted
Did you find this error? It indicates that your memory is very less to execute the PHP code (uploading large images, delete a lot of products, send mass mails etc.). Therefore, increasing the memory allocated for PHP will solve the issue.Error variant:
- Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 47200 bytes) in /path/public_html/system/library/image.php on line 34
- Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 13069817 bytes) in /path/public_html/system/library/mail.php on line 144
- Fatal error: Out of memory (allocated 33554432) (tried to allocate 14024 bytes) in /path/public_html/library/image.php on line 34
Apply one of these above solutions below to increase the limit to 64MB, 128MB, 256MB or 512MB -depends on your host.
- Edit php.ini
memory_limit = 128M;
- Or put code below to .htaccess
php_value memory_limit 128M
- If you are still facing this issue and above solution doesn’t work, get in touch to your host. At maximum shared hosting, there is a maximum of memory_limit. You can’t set memory-limit to 64Mb if you get max 32Mb.