I can't stay logged in to my Admin area -- or -- PHP Session Handling isn't working for me.

THE FIRST THING TO TRY is this:
- Close all your browser windows
- Open 1 browser window, and use it to clear your browser cache AND cookies.
- If you browser has a Private Browsing mode, make sure you're NOT using "Private Browsing" mode, because that will prevent sessions/cookies from being usable
- Reboot your computer
- Turn off your firewall software and try again.
- Ensure that your stylesheets don't contain any references to image files that don't exist on your server.
- Test in a completely different browser. IE and Chrome are known to be problematic with cookies sometimes. Switching to FireFox is a good troubleshooting step.

- Don't use spaces in your domain names, nor in the foldernames in which you've installed your store. If yours has a space in the path anywhere, you may have troubles. Rename the folder instead.

NEXT, try to rule out a bad SSL configuration:
- edit your /admin/includes/configure.php and change ENABLE_SSL_ADMIN to 'false'
- clear browser cache AND cookies and try again
then if it's still not working:
- edit your /admin/includes/configure.php and change HTTP_SERVER to a URL that does NOT start with 'https'
- clear browser cache AND cookies and try again

IS IT A DOMAIN NAME PROBLEM?
- if your site is using just an IP address and not a named domain, then it's possible your sessions/cookies are getting confused.  Edit your 2 configure.php files and set your HTTP_SERVER to an actual domain name, NOT an IP address.
- if you're using a domain name with "www." in it, try removing the "www." from it temporarily ... again, in the HTTP_SERVER setting, and with ENABLE_SSL_ADMIN set to false.

IF IT STILL WON'T WORK, read on:
Admin login sessions (and customer login sessions) are managed via the PHP session-handling functionality.
When you log in, a session is generated, and the session's name is zenAdminId or zenid (for the store).
When a session is started, PHP attempts to set a cookie in your browser. That cookie is intended to store that session ID so that it doesn't need to be shown in the browser all the time (ie: with &zenAdminID=243524524524525 etc) at the end of all your URLs.
If a cookie cannot be set, then PHP simply includes the session name and number (like above) on all your URLs in order to keep you logged in. 
When you log out, or the session ID is lost, the session data is reset and your authentication data is removed, requiring login again.

Possible causes of session-mgmt problems include:
- cookies are blocked by firewall or by browser configuration
- PHP is misconfigured or has certain session settings set to methods incompatible with Zen Cart such as session-auto-start and transitive-sid etc. The installer warns about these if they are a problem.
- you have your site configured to store session data in files but your filesystem doesn't have permissions set in such a way as to allow storage of the data
- you have your site set to store session data in the database but the database table ("sessions") is corrupt or database-storage is full and new records cannot be added.

In your /admin/includes/configure.php, what is your setting for STORE_SESSIONS?  Is the setting the same for your /includes/configure.php file ?
Is your "cache" folder set to read/write (ie: chmod 777 (or some other suitable value if 777 is not permitted by your server's configuration) ?

Other possibilities:
a) altered files on your server. In that case a proper checkup of all your files is in order: http://www.zen-cart.com/wiki/index.p...Obscure_Issues

b) a server configuration change by the hosting company (such as a PHP version change or anything else that might result in changes to the master php.ini configuration for the server or your hosting account)
  • 235 Users Found This Useful
Was this answer helpful?

Related Articles

How can I find out what version of Zen Cart or PHP or MySQL I'm using?

To find out what version of Zen Cart or PHP or MySQL you are currently using, you can simply go...

Getting a BLANK PAGE? Here's the answer ...

If you're getting a blank page when trying to browse to a certain page on your store, or after...

What's New in the Upcoming v2.0 release?

Database Abstraction Layer and Sql CacheThe abstraction layer has been re-factored to include a...

Image Preparation - How-to

I've seen several posts where people obviously aren't quite sure about the best way to set up...

Some tips to modify stylesheet

1. Download Web Developer extension for FireFox here2. Install & restart FireFox. You should...