Jump to content
medvid

Who's Online Enhancement 1.4

Recommended Posts

appreciate the reply.

 

I tried with mysql and it worked great.

 

So if i use the tmp file in my catalog directory, are the sessions automatically deleted every 24 minutes like they are when using mysql or does it have to be done manually?

Share this post


Link to post
Share on other sites

i really appreciate all the help.

 

ive switched to mysql and all seems to be working great. Ill check later to make sure my sessions are being removed every 24 minutes.

 

One final question - I set the configure.php in admin to use mysql sessions as well. What is the point of storing admin sessions - wouldnt this be a security threat?

Share this post


Link to post
Share on other sites

please help,

 

after a few minutes of being set to mysql,

 

my site stopped working.

 

i get a too many connections error in database.php line 19

 

please help

 

i changed back to file based, but still doesnt work now...?

Share this post


Link to post
Share on other sites

Warning: mysql_connect(): Too many connections in /home/tools4fl/public_html/includes/functions/database.php on line 19

Unable to connect to database server!

 

thats my error on each attempt

Share this post


Link to post
Share on other sites

Jon,

 

Yikes! Simple empirical evidence suggests you shouldn't use mySQL for sessions. Give it a few minutes or get your admin to bounce the server. And definitely switch back to files.

 

ed

Edited by medvid

Answers to osCommerce's most persistent questions! Tips & Tricks | Configuration | Common Problems.

Seek and ye shall find Contributions.

My Contributions

My Blog

Share this post


Link to post
Share on other sites
Andrea,

 

Where are your sessions stored? Files or mySQL?  Do you have Force Cookie Use =True or False?

 

ed

 

 

mysql, forced cookies = false

 

Can't figure out the problem, maybe I should try not using mysql for sessions and see how that works.

Share this post


Link to post
Share on other sites
i really appreciate all the help.

 

ive switched to mysql and all seems to be working great. Ill check later to make sure my sessions are being removed every 24 minutes.

 

One final question - I set the configure.php in admin to use mysql sessions as well. What is the point of storing admin sessions - wouldnt this be a security threat?

 

 

I use mysql sessions, they are deleted just like the tmp file ones are :)

Share this post


Link to post
Share on other sites
mysql, forced cookies = false

 

Can't figure out the problem, maybe I should try not using mysql for sessions and see how that works.

 

Andrea,

If you do, make sure to set:

define('STORE_SESSIONS', '');

in both catalog/configure.php and admin/configure.php and that your session tmp file exists and doesn't have a leading slash.

 

Let me know how it works.

 

ed


Answers to osCommerce's most persistent questions! Tips & Tricks | Configuration | Common Problems.

Seek and ye shall find Contributions.

My Contributions

My Blog

Share this post


Link to post
Share on other sites
Andrea,

If you do, make sure to set:

define('STORE_SESSIONS', '');

in both catalog/configure.php and admin/configure.php and that your session tmp file exists and doesn't have a leading slash.

 

Let me know how it works.

 

ed

 

 

I used to use non-mysql session files before I installed the whos_online enhanced mod, then I had to switch to mysql to see the cart and light info. Installing the whos_online mod on a live store so I have to wait until my store traffic dies down before I can switch to files... don't want to drop sessions for 20-30 people and have them wonder whats wrong :(

Share this post


Link to post
Share on other sites

Ok, I switched over to file and it seems to be working much better.... but I lost the ability to see in the cart and the lights all indicate "no cart". I tried putting stuff in my cart and seeing if it worked, still nothing :(

 

Don't know what the trouble is now

Share this post


Link to post
Share on other sites
Ok, I switched over to file and it seems to be working much better.... but I lost the ability to see in the cart and the lights all indicate "no cart". I tried putting stuff in my cart and seeing if it worked, still nothing :(

 

Don't know what the trouble is now

Andrea,

 

You said earlier you switched back to v1.5.1. Did you reinstall v1.6 beta?

 

ed


Answers to osCommerce's most persistent questions! Tips & Tricks | Configuration | Common Problems.

Seek and ye shall find Contributions.

My Contributions

My Blog

Share this post


Link to post
Share on other sites
Andrea,

 

You said earlier you switched back to v1.5.1.  Did you reinstall v1.6 beta?

 

ed

 

Yes, switched back to beta 1.6, switch to file sessions. Page error is gone, but cart info is gone as well.... my bad luck today I guess :(

Share this post


Link to post
Share on other sites

Might have it figured out...

 

This is the code for the for file sessions to be picked up:

 

      if ( (file_exists(DIR_FS_CATALOG . tep_session_save_path() . '/sess_' . $session_id)) && (filesize(DIR_FS_CATALOG . tep_session_save_path() . '/sess_' . $session_id) > 0) ) {
       $session_data = file(DIR_FS_CATALOG . tep_session_save_path() . '/sess_' . $session_id);
       $session_data = trim(implode('', $session_data));

 

DIR_FS_CATALOG = /local/home/xxx/xxx.com/

 

my sessions path is set to: /local/home/xxx/tmp_sessions

since I put sessions files below the home directory

 

they aren't matching up... could this be the problem? The other info is showing up though so I am not sure if that could really be it ....

Share this post


Link to post
Share on other sites

Andrea,

 

More like my bad luck. I have this working perfectly on a shop and I can switch sessions back and forth from mySQL to files with no problems. Lights work, cart shows up, no error messages.

 

Some people installed it and claimed it's working great. Others are getting errors. I'm starting to think that the session data is very dependent on environment variables I'm not aware of.

 

Well, that's one reason why I posted a Beta. There's no other easy way to test it. However, I feel bad Jon's site went down. Hopefully it recovered.

 

BTW, you did modify both configure.php files, make sure admin->configuration->sessions-session directory doesn't have a leading slash, made sure the directory existed under catalog, and has write permissions, right?

 

ed


Answers to osCommerce's most persistent questions! Tips & Tricks | Configuration | Common Problems.

Seek and ye shall find Contributions.

My Contributions

My Blog

Share this post


Link to post
Share on other sites
Might have it figured out...

 

This is the code for the for file sessions to be picked up:

 

 ? ? ?if ( (file_exists(DIR_FS_CATALOG . tep_session_save_path() . '/sess_' . $session_id)) && (filesize(DIR_FS_CATALOG . tep_session_save_path() . '/sess_' . $session_id) > 0) ) {
? ? ? ?$session_data = file(DIR_FS_CATALOG . tep_session_save_path() . '/sess_' . $session_id);
? ? ? ?$session_data = trim(implode('', $session_data));

 

DIR_FS_CATALOG = /local/home/xxx/xxx.com/

 

my sessions path is set to: /local/home/xxx/tmp_sessions

since I put sessions files below the home directory

 

they aren't matching up... could this be the problem? The other info is showing up though so I am not sure if that could really be it ....

 

Andrea,

 

Either move the session directory under catalog or hard code the directory path into the code.

 

ed


Answers to osCommerce's most persistent questions! Tips & Tricks | Configuration | Common Problems.

Seek and ye shall find Contributions.

My Contributions

My Blog

Share this post


Link to post
Share on other sites
Andrea,

 

More like my bad luck.  I have this working perfectly on a shop and I can switch sessions back and forth from mySQL to files with no problems.  Lights work, cart shows up, no error messages.

 

Some people installed it and claimed it's working great.  Others are getting errors.  I'm starting to think that the session data is very dependent on environment variables I'm not aware of.

 

Well,  that's one reason why I posted a Beta.  There's no other easy way to test it.  However, I feel bad Jon's site went down.  Hopefully it recovered.

 

BTW, you did modify both configure.php files, make sure admin->configuration->sessions-session directory doesn't have a leading slash, made sure the directory existed under catalog, and has write permissions, right?

 

ed

 

Both configs changed, no leading slash... I'm going to try to create the temp directory in the catalog directory and see what happens. Right now it's one under the home so no one can get at it...

 

I should be setting the sessions directory to just the directory name if I do that correct? just: /session_tmp NOT /local/home/xxx/xxx.com/session_tmp right?

Share this post


Link to post
Share on other sites
Both configs changed, no leading slash... I'm going to try to create the temp directory in the catalog directory and see what happens. Right now it's one under the home so no one can get at it...

 

I should be setting the sessions directory to just the directory name if I do that correct? just:  /session_tmp  NOT /local/home/xxx/xxx.com/session_tmp  right?

 

Andrea,

 

Just "session_tmp". The slash will put it at the root of the file system.

 

ed


Answers to osCommerce's most persistent questions! Tips & Tricks | Configuration | Common Problems.

Seek and ye shall find Contributions.

My Contributions

My Blog

Share this post


Link to post
Share on other sites
Warning: mysql_connect(): Too many connections in /home/tools4fl/public_html/includes/functions/database.php on line 19

Unable to connect to database server!

 

thats my error on each attempt

 

Jon,

 

Did you get this sorted out?

 

ed


Answers to osCommerce's most persistent questions! Tips & Tricks | Configuration | Common Problems.

Seek and ye shall find Contributions.

My Contributions

My Blog

Share this post


Link to post
Share on other sites

what a huge relief!

 

it turns out my host was updating the SQL, so all sites on my server were down for about 20 minutes.

 

I now have sessions set to mysql in both config.php files, and all works great!

 

The mod works perfect, the lights and cart contents are now shown.

 

 

My only remaining concern is that the automatic removal every 24 minutes of the sessions from the sessions table will work right. I guess ill just keep checking the table to see if it grows out of control...

But ed, is this working for you?

Share this post


Link to post
Share on other sites
Andrea,

 

Just "session_tmp".  The slash will put it at the root of the file system.

 

ed

 

 

Ok, still not work, just can't get the cart to show :( No idea why. If anyone has any suggestions I will try. No matter where I put the sessions directory it is not showing. And since I can see the referer, the current page and the time on the site I assume sessions are working, just not the cart part.

Share this post


Link to post
Share on other sites
My only remaining concern is that the automatic removal every 24 minutes of the sessions from the sessions table will work right. I guess ill just keep checking the table to see if it grows out of control...

But ed, is this working for you?

 

 

Mysql sessions are deleted just like file sessions. I was using that before and it works perfectly.

 

:)

Share this post


Link to post
Share on other sites

thanks for the reply.

 

so both the file sessions and mysql sessions are automatically deleted at ~ 24 min. intervals?

Share this post


Link to post
Share on other sites
thanks for the reply.

 

so both the file sessions and mysql sessions are automatically deleted at ~ 24 min. intervals?

 

 

Not sure how long between deletions, but the old ones are deleted.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×