0

I have a standard oscommerce installation and when a session variable contains a multibyte character such as Japanese it creates the error "Warning: session_start(): Trying to destroy uninitialized session". The stack trace doesn't shed a great deal of light on what's causing the problem except that it is caused in the session class file on the following statement:

...
return session_start();

The Error is caused by a variable like this:

$shipping['method'] = {Japanese character string}

tep_start_session('shipping');

...and then the error is experienced on every subsequent page load.

Any ideas greatly appreciated!

user3481238
  • 93
  • 1
  • 5
  • Where are you starting the session? – ClearBoth Jan 24 '16 at 08:47
  • The session is loaded in application_top.php on every page: tep_session_start(); $session_started = true; – user3481238 Jan 24 '16 at 09:50
  • I should stress, this issue only occurs when there are Japanese characters in the variable, fine otherwise. – user3481238 Jan 24 '16 at 09:51
  • Some of the session variables are being passed from jquery, so is there a chance that they are becoming corrupt in the ajax call from jquery to php? Perhaps the multibyte encoding needs to be specified? – user3481238 Jan 24 '16 at 10:58

1 Answers1

0

This turned out to be caused by a complicated reason in oscommerce. I have noticed the same error in other international websites and therefore thought I would post the answer as there is very little information discussed elsewhere.

Many variables are stored in sessions, which may be stored in the MySQL database.

It is therefore critical that you change the collation of the "session" table in the MySQL database to utf8_general_ci to allow for the correct storage and retrieval of multibyte characters in the database stored sessions.

user3481238
  • 93
  • 1
  • 5