Yii Framework Forum: Issue: Concurrent Web Applications On Same Machine - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Issue: Concurrent Web Applications On Same Machine Rate Topic: -----

#1 User is offline   thiagovidal 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 147
  • Joined: 17-February 10
  • Location:Brazil, São Paulo

Posted 20 February 2013 - 10:19 AM

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???
0

#2 User is offline   le_top 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 442
  • Joined: 08-June 10
  • Location:France (Ile-de-France/Val d'Oise)

Posted 20 February 2013 - 02:44 PM

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.

0

#3 User is offline   thiagovidal 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 147
  • Joined: 17-February 10
  • Location:Brazil, São Paulo

Posted 21 February 2013 - 12:53 PM

View Postle_top, on 20 February 2013 - 02:44 PM, said:

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.
0

#4 User is offline   thiagovidal 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 147
  • Joined: 17-February 10
  • Location:Brazil, São Paulo

Posted 21 February 2013 - 01:04 PM

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.
0

#5 User is offline   rootbear 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 225
  • Joined: 17-June 11

Posted 21 February 2013 - 01:34 PM

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

I enjoy the Yii.sy coding life here.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users