Ajax and Ajax Frameworks

I have been a developer for nearly 20 years and a web developer for about 10 years. Over the years, I have considered creating a blog to share the things I have learned (and am learning) about web design and development, but I never seemed to have the time. When I began learning about web development using Ajax and Ajax Frameworks, I decided to take the time to create this blog.

My intention for this blog is to focus primarily on Ajax Frameworks, but since web development requires knowledge of many technologies, I will occasionally write about things such as CSS, Javascript, PHP, MySQL, Flash, etc.

Lately, I have been using JQuery as my primary Ajax tool. Although I have used other Ajax Frameworks in the past (Dojo Toolkit, Yahoo! User Interface Library, Scriptaculous/Prototype), JQuery has thus far been the easiest to learn. In my first few posts I will discuss some of the JQuery Plugins that I have created. Some of these include: a plugin for Google Maps (jquery.imGoogleMaps), Form validation and submission  (jquery.imValidateForm), Page Populater (jquery.imPagePopulate), and a plugin to create lists (jquery.imList).

While I am still learning about some of the other Ajax Frameworks, I hope that what I have learned will be helpful to others. Just remember, “When you can pull the pebbles from my hand…”

CakePHP Session Write Auth Error

Friday, January 15th, 2010

I justed received an error when logging into a CakePHP app. It was the Auth Component error:

you are not authorized to access that location

It occurred when I attempted to create two session variables:

if ($loggedIn == 1) {
	$result = $this->User->findByUsername($this->Auth->user("username"));
	if ($result) {
		$this->Session->write('User.langID', $result['User']['language_id']);
		$this->Session->write('User.cntryID', $result['User']['country_id']);
		echo '{"type":"continue"}';
	}
}

Because one generally receives this error message when attempting to access a page that is secured by the Auth Component and ACL, I thought that the session component was attempting to write to a restricted area. After a bit of testing, I realized that the User session var (User.langID) was being used by the Auth Component. So I changed User to an application specific variable:

$this->Session->write('rdsStaff.langID', $result['User']['language_id']);
$this->Session->write('rdsStaff.cntryID', $result['User']['country_id']);

No more errors. I hope this will be useful to someone in the same situation.

Related posts

CommentLuv Enabled