Issue: Concurrent Web Applications On Same Machine

Hi.

I’m working on several projects on same machine (localhost). I was working on one project in particular for a time and left the others untouched. Today I had to run another project and realize they are sharing user states between applications. Like… I set user flash on one app and the flash messages are showed on other too.

Another thing I realized is when I use different browsers with different users… the flash messages are set for both users.

When I disable session on db it stops to happen. Am I doing something wrong???

Giving a different application id to each of the applications will probably stop this from happening. You need to do this in the configuration file:





        'id'=>'061c8ef5', // some random string unique for your application.



Thanks for your reply but it didn’t work.

I’ve tried so far…




	array(

		'id'=>'061c8ef5',

		'components'=>array(

			'request'=>array(

				'enableCsrfValidation'=>true,

				'csrfTokenName'=>'APP_CSRF_TOKEN',

				'enableCookieValidation'=>true,		

			),		

			'session'=>array(

				'class'=>'system.web.CDbHttpSession',

				'connectionID'=>'db',

				'sessionTableName'=>'app_session',

				'sessionName'=>'APP',

				'timeout' => 18000,

				'autoStart'=>true,

			),

			'user'=>array(

				'class'=>'AWebUser',

				'loginUrl'=>array('/account/login'),

				'stateKeyPrefix'=>'APP_',

				'allowAutoLogin'=>true,

			),



Nothing seems to work.

  1. check if session table got populated correctly; all fields filled with data

  2. change this line each app


'sessionTableName'=>'app_session_<unique_id>',  //replace <unique_id> with actual number for each app