Zen Cart Logo
Forums / Installing on a Linux/Unix Server / New reinstall, sessions seem to last a random amount of time

New reinstall, sessions seem to last a random amount of time

Views: 2,870

Results 1 to 15 of 15
17 Apr 2015, 16:27
#1
benvanderjagt avatar

benvanderjagt

New Zenner

Join Date:
Mar 2012
Posts:
14
Plugin Contributions:
0

New reinstall, sessions seem to last a random amount of time

Hi all,

My inventory was an organizational mess, and then my database went screwy, so I decided to just do the whole thing fresh with the latest Zencart 1.5.4.

I haven't installed any add-ons, and everything seems to have gone smoothly. My only problem is that sessions, both for admin and for customers, last a seemingly random amount of time. Sometimes I have to login twice in a row to my Admin control panel. I have done plenty of searching and tried the common suggested fixes. At the moment, I'm testing with Recreate Sessions set to False. I'll update here if that makes a difference.

I'm running on an openSUSE Linux 13.2 box, fully up-to-date. I do my own DNS, and the store doesn't use a leading www. hostname (though it is aliased). I don't have any other Zencart installations on this server, but I run a dozen or so different sites without issue using the current config.

Everything else seems to be working great, and I've tried to do everything the "right way" this time, without adding third-party code. I don't know what else to try.

Any help or additional suggestions is very much appreciated.

17 Apr 2015, 16:49
#2
benvanderjagt avatar

benvanderjagt

New Zenner

Join Date:
Mar 2012
Posts:
14
Plugin Contributions:
0

Re: New reinstall, sessions seem to last a random amount of time

Sorry, I tried to find a way to edit my existing post, but I didn't see any.

I still get randomly logged out even with Recreate Session disabled. It's so unpredictable, too. Last night, I listed four items in one login session, and then I had to log in six times in the middle of listing the next two items.

18 Apr 2015, 09:00
#3
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: New reinstall, sessions seem to last a random amount of time

so I decided to just do the whole thing fresh with the latest Zencart 1.5.4.
You did not provide your server versions of:
apache
php
mysql
etc

18 Apr 2015, 11:28
#4
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: New reinstall, sessions seem to last a random amount of time

With regards to logging into the admin screen twice, that can happen if one has logged out to goto the aadmin login screen and then not taken any action while on that screen before the session timeout occurs. Then once the session timeout occurs, the initial attempt to login causes a page reload and session restart, the second attempt should return the admin into the admin area.

That said, seems there is something else going on that is kicking you out after login and before the session timeout.

18 Apr 2015, 14:01
#5
benvanderjagt avatar

benvanderjagt

New Zenner

Join Date:
Mar 2012
Posts:
14
Plugin Contributions:
0

Re: New reinstall, sessions seem to last a random amount of time

kobra:

You did not provide your server versions of:
apache
php
mysql
etc

Oops, that was pretty amateur of me.

BIND 9.9.5
Apache 2.4.10
PHP 5.6.1
MariaDB 10.0.13
Linux Kernel 3.16.7

I think the only non-standard setting in my .conf files is "auto_detect_line_endings = Off".

Here's another detail. In the past, I used an automatic tab reload script to keep myself logged in. Many times, it would take me longer than 15 minutes to create a new listing, because of the amount of detail I would add. Instead of letting it boot me out as soon as I finish all that work, I would have a tab-reload add-on for Firefox keep reloading the main admin page every 10 minutes. Now, it doesn't matter if I have it reload every 30 seconds.

I'm seriously considering building yet another web server on another whole new box, using one of the more common setups like Ubuntu, and just forcing myself to be on the same page as everyone else. It probably wouldn't help discover the cause of the issue, and it would be a lot of extra work, but at least then my store would be fully functional.

Thank you again for all of your help.

20 Apr 2015, 01:17
#6
benvanderjagt avatar

benvanderjagt

New Zenner

Join Date:
Mar 2012
Posts:
14
Plugin Contributions:
0

Re: New reinstall, sessions seem to last a random amount of time

I think I've found another characteristic. If I stay active in one single browser tab, I seem to have a 15 minute timeout. This doesn't seem to make much sense, since I can log in on one tab and then browse around on the other tabs.

I've now had this same issue twice. Has anyone else heard of this? There must be something strange that I don't see about my current setup.

27 Apr 2015, 21:10
#7
benvanderjagt avatar

benvanderjagt

New Zenner

Join Date:
Mar 2012
Posts:
14
Plugin Contributions:
0

Re: New reinstall, sessions seem to last a random amount of time

Sorry to bump this, but does anyone have any suggestions? I haven't even had a single sale, though I've had about 10k visits. I used to average a couple sales a day. I tested and confirm that the checkout system works, but it keeps losing sessions, so I honestly don't know if people are just getting frustrated and leaving.

I'm considering just putting the store back in maintenance mode, because I really can't think what else it might be.

29 Apr 2015, 05:34
#8
nigelt74 avatar

nigelt74

Totally Zenned

Join Date:
Sep 2005
Location:
Waikato, New Zealand
Posts:
1,558
Plugin Contributions:
1

Re: New reinstall, sessions seem to last a random amount of time

  1. How about a link to your site so we can see the behaviour for ourselves, if its live that is just in case we spot something you may not have
  2. What are your settings regarding cookies
  3. Are you still using the default "classic" template or do you have your own template installed, if so does this issue still happen if you switch back to the classic?
  4. have you tried in another browser eg Firefox instead of Chrome
  5. Do you have SSL installed?
06 May 2015, 01:42
#9
benvanderjagt avatar

benvanderjagt

New Zenner

Join Date:
Mar 2012
Posts:
14
Plugin Contributions:
0

Re: New reinstall, sessions seem to last a random amount of time

Sorry it took so long to reply. I've just been running around putting out fires everywhere.

  1. Sure, the site is https://www.laptopcrap.com and it's currently live. I left it live for now, though I still haven't sold anything. I tested going through the checkout process, up to the last step, and it's possible to buy items. The main place where this is frustrating is entering new items into the inventory, and as anyone who watches the numbers knows, the more items you have, the more traffic you get (and not just spiders).

  2. The only thing I changed regarding cookies was in the Admin -> Configuration -> Sessions. I tried several combinations of "Force Cookie Use", "Recreate Sessions", and "Add Period Prefix". None seemed to affect the behavior at all.

Because of the amount of work involved, I haven't tried a lot of different versions / server configurations, but it seems that Zencart 1.3.9 works perfectly on my server. I have an old (mostly broken) site running on that version, and aside from LOTS of white pages with no PHP errors, it will stay logged in as expected.

  1. I'm still using the Classic Contemporary Green template.

  2. I can reproduce the random logout problem in Chrome, Firefox, and IE. On a related note, I use the site on Linux and Windows XP and 7 computers. I have old, well-used installs of OS's, as well as brand new (literally brand new) computers that have the same issue.

  3. I'm not using SSL.

Does anybody know if I can use the existing database on version 1.3.9? Also, it was a buggy mess that seemed to get worse the more products I listed, but I never did figure out if that was because of the very old server it was running on. It would give blank pages very often, and it never produced any PHP messages with logging enabled and error messages visible. Was that something wrong with the 1.3.x series, or was it just my old old server? I'm open to wild guesses at this point, as I absolutely hate to use eBay for anything, and I insist on making an open-source solution work.

Thank you again.

06 May 2015, 15:42
#10
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: New reinstall, sessions seem to last a random amount of time

Does anybody know if I can use the existing database on version 1.3.9
If you mean the DB for ZenCart 1.5.4 - - then NO it is not backward compatible

06 May 2015, 17:05
#11
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: New reinstall, sessions seem to last a random amount of time

When you said you tried the various session settings, did you clear your cache between each successive test?

What are the settings currently?

What is in your includes/configure.php and admin/includes/configure.php regarding the cache?

Was this store put together from an upgraded database where the original store location stillexists in your directory structure but is in a different location than the current store?

09 May 2015, 13:55
#12
benvanderjagt avatar

benvanderjagt

New Zenner

Join Date:
Mar 2012
Posts:
14
Plugin Contributions:
0

Re: New reinstall, sessions seem to last a random amount of time

mc12345678:

  1. When you said you tried the various session settings, did you clear your cache between each successive test?

  2. What are the settings currently?

  3. What is in your includes/configure.php and admin/includes/configure.php regarding the cache?

  4. Was this store put together from an upgraded database where the original store location stillexists in your directory structure but is in a different location than the current store?

  1. I did.

  2. Here is a copy and paste from my Admin page.

Session Directory /apache/winchesterpc.com/www/storestore/cache
Cookie Domain False
Force Cookie Use True
Check SSL Session ID False
Check User Agent False
Check IP Address False
Prevent Spider Sessions True
Recreate Session False
IP to Host Conversion Status true
Use root path for cookie path False
Add period prefix to cookie domain False

/includes/configure.php
define('SQL_CACHE_METHOD', 'database');
define('DIR_FS_SQL_CACHE', '/apache/winchesterpc.com/www/storestore/cache');

/[admin]/includes/configure.php
define('DIR_FS_SQL_CACHE', '/apache/winchesterpc.com/www/storestore/cache');

  1. The last store was so buggy that I decided to start totally from scratch. I still have an archive of the old store, which I think was 1.3.9h, but it's not on the server.

Thank you again for your help. Since still nothing has sold, I'm able to copy and paste my information into a version 1.3.9h install with relative ease if need be, so I do have sort of a workaround.

10 Jul 2015, 23:36
#13
benvanderjagt avatar

benvanderjagt

New Zenner

Join Date:
Mar 2012
Posts:
14
Plugin Contributions:
0

Re: New reinstall, sessions seem to last a random amount of time

Hi all,

I ended up making a workaround of sorts, but in the remote chance that someone else has the same problem I have, I wanted to add one more piece of information. The automatic reminder to change my password every time I sneeze seems to be broken, and I haven't had to change my password at all. What luck, a bug seems to have broken one of my least favorite features! Anyway, for whatever reason doing another fresh install on another fresh server seems to work properly. As far as I can tell, the two servers are configured identically. All I can suggest, if anyone else runs across this thread, is to use the old Windows 98 method: Reinstall everything and try again.

11 Jul 2015, 02:51
#14
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: New reinstall, sessions seem to last a random amount of time

On another note, maybe should see a doctor about all that sneezing. :P

14 Jul 2015, 00:32
#15
benvanderjagt avatar

benvanderjagt

New Zenner

Join Date:
Mar 2012
Posts:
14
Plugin Contributions:
0

Re: New reinstall, sessions seem to last a random amount of time

The sneezing had gotten pretty rough. It was to the point that I was banging my head against the keyboard with each sneeze/password reset, which was how I came up with most of my passwords.