diff --git a/cas_server.module b/cas_server.module
index e2a5b47..2030f76 100644
--- a/cas_server.module
+++ b/cas_server.module
@@ -69,8 +69,8 @@ function cas_server_theme() {
 
 function cas_server_service_return() {
   global $user;
-  $service = $_COOKIE[CAS_LOGIN_COOKIE];
-  if ($service && $user->uid) {
+  if (isset($_COOKIE[CAS_LOGIN_COOKIE]) && isset($user->uid)) {
+    $service = $_COOKIE[CAS_LOGIN_COOKIE];
     $ticket = _cas_server_save_ticket($user->uid, $service);
     setcookie(CAS_LOGIN_COOKIE, "", -3600);
     drupal_goto($service, array('query' => array('ticket' => $ticket)));
@@ -86,19 +86,19 @@ function cas_server_login() {
   global $user;
   $output='';
   if ($user->uid) {
-    if ($_GET['service']) {
+    if (isset($_REQUEST['service'])) {
       $_COOKIE[CAS_LOGIN_COOKIE] = $_REQUEST['service'];
     }
     $output=t('You have successfully logged into CAS');
     cas_server_service_return();
   }
   else {
-    if (isset($_GET['gateway']) && isset($_GET['service'])) {
-      drupal_goto($_GET['service']);
+    if (isset($_REQUEST['gateway']) && isset($_REQUEST['service'])) {
+      drupal_goto($_REQUEST['service']);
     }
     else {
       // Redirect to user login
-      if ($_GET['service']) {
+      if (isset($_REQUEST['service'])) {
         setcookie(CAS_LOGIN_COOKIE, $_REQUEST['service']);
       }
       $output .= l(t('Login'), 'user', array('query' => array('destination' => 'cas/login')));
@@ -114,8 +114,9 @@ function cas_server_login() {
  */
 function cas_server_validate() {
   //Obtain the ticket from the url and validate it.
-  $ticket = $_GET['ticket'];
-  $service = $_GET['service'];
+  $ticket = isset($_REQUEST['ticket']) ? $_REQUEST['ticket'] : '';
+  $service = isset($_REQUEST['service']) ? $_REQUEST['service'] : '';
+
   $user_name = _cas_server_validate($service, $ticket);
   if ($user_name) {
     print "yes\n";
@@ -126,15 +127,17 @@ function cas_server_validate() {
     print "\n";
   }
 }
+
 /**
  * serviceValidate method using cas 2.0
  * Returns data in xml
  */
 function cas_server_service_validate() {
-  $ticket = $_GET['ticket'];
-  $service = $_GET['service'];
+  $ticket = isset($_REQUEST['ticket']) ? $_REQUEST['ticket'] : '';
+  $service = isset($_REQUEST['service']) ? $_REQUEST['service'] : '';
+
   $user_name = _cas_server_validate($service, $ticket);
-  if (!$user_name ) $cas_error='INVALID_TICKET';
+  if (!$user_name) $cas_error='INVALID_TICKET';
   if (!$ticket || !$service) $cas_error='INVALID_REQUEST';
 
   header('Content-type:', 'text/xml');
@@ -206,8 +209,8 @@ function cas_server_logout() {
   session_destroy();
   module_invoke_all('user', 'logout', NULL, $user);
   $output = t('<p>You have been logged out successfully</p>');
-  if ($_GET['url'])  {
-    $output .= '<p>' . l(t('Continue'), $_GET['url']) . '</p>';
+  if (isset($_REQUEST['url'])) {
+    $output .= '<p>' . l(t('Continue'), $_REQUEST['url']) . '</p>';
   }
   return $output;
 }
\ No newline at end of file
