Yii Framework Forum: URGENT: AJAX call issue - Yii Framework Forum

Jump to content

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

URGENT: AJAX call issue Rate Topic: -----

#1 User is offline   mickeyckm 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 10
  • Joined: 25-March 10

Posted 15 April 2010 - 08:29 AM

Hi,

I'm sorry that I keep posting the same issue. Everyday, I'm on step closer. Finally, I have found the exact problem and I hope someone can really help me.

Here's the scenario:
I'm trying to go an AJAX call to a ProductController with actionUploaded()

I tried for two nights and cant seem to find an issue till today. The main problem is the Uploaded action got redirect to login page because the AJAX call is considered unauthenticated.

If I change the rule for action uploaded to "*", means anyone can access the action, it will work perfectly fine.

I did send PHPSESSID during the AJAX call and run this at the start of the actionUpload():
Yii::app()->session->sessionID = $_POST['PHPSESSID'];
Yii::app()->session->init();

It just didnt work and it redirect. to login page.

Is there any ways I can keep it logged in while doing an AJAX POST call?

Cheers,
Mickey
0

#2 User is offline   mickeyckm 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 10
  • Joined: 25-March 10

Posted 15 April 2010 - 08:42 AM

Any idea? What keeps the AJAX call authenticated?
0

#3 User is offline   mickeyckm 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 10
  • Joined: 25-March 10

Posted 15 April 2010 - 09:06 AM

If flash does not pass the session as stated in the documentation,
http://www.yiiframew...euploadify/#doc

It means that the action must be open to anonymous, etc, AccessRule to actionUploaded must be *. How can we check back in the action?

	public function actionUploaded()
	{
	    // flash does NOT pass the session
	    // thus we pass the id with a $_POST variable
	    Yii::app()->session->sessionID = $_POST['PHPSESSID'];
	    Yii::app()->session->init();
            ....
            // WHAT CAN I DO HERE TO CHECK WHETHER IT IS AUTHENTICATED?
        } 

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