diff -Naur original/category.php updated/category.php
--- original/category.php	2008-10-29 09:34:02.000000000 -0500
+++ updated/category.php	2008-10-28 09:37:40.000000000 -0500
@@ -257,7 +257,8 @@
         if (has_capability('moodle/category:create', $context)) {   // Print button for creating new categories
             unset($options);
             $options['categoryadd'] = 1;
-            $options['id'] = $id;
+            $options['id'] = $_GET['id'];
+            $options['sesskey'] = $USER->sesskey;
             print_single_button('editcategory.php', $options, get_string('addsubcategory'), 'get');
         }
         echo '</div>';
diff -Naur original/editcategory.php updated/editcategory.php
--- original/editcategory.php	2008-10-29 09:34:14.000000000 -0500
+++ updated/editcategory.php	2008-10-28 09:37:46.000000000 -0500
@@ -42,7 +42,7 @@
     }
 }
 
-$mform = new editcategory_form('editcategory.php', compact(array('category', 'id')));
+$mform = new editcategory_form('editcategory.php', compact(array('category', 'id', 'sesskey')));
 
 if (!empty($category)) {
     $mform->set_data($category); 
@@ -77,7 +77,7 @@
         } else {
             $newcategory->context = get_context_instance(CONTEXT_COURSECAT, $newcategory->id);
             mark_context_dirty($newcategory->context->path);
-            redirect('index.php?categoryedit=on');
+            redirect('category.php?id=' . $newcategory->id . '&categoryedit=on&sesskey=' . $_POST['sesskey'] );
         }
     } elseif (has_capability('moodle/category:update', $context)) {
         $newcategory->id = $category->id;
@@ -341,6 +341,7 @@
 print_header($title, $fullname, $navigation, $mform->focus());
 print_heading($strtitle);
 
+
 $mform->display();
 
 print_footer();
