Solved

Security token service isn't passed to server when i have ajax request.

Posted on 2011-09-07
7
405 Views
Last Modified: 2013-01-21
I have a strange issue that I cannot figure out.
I am doing an AJAX request as follows:

    $.ajax({
        type: "POST",
        url: "ajax/getCities.htm",
        dataType: "html",
               success: populateCityCountyFromSession
    });

For some reason, the firebug show a 302 error code for POST request and a failed GET request (because the parameters are not being sent). If I put a breakpoint in the javascript and iterate through then the GET request doesn't happen, so I've been unable to determine whether or not the issue has to do with jQuery.

Finally i found one thing, for ajax or jquery request the authenticated cookie(Wif ) isn't passed,

How to i pass the wif authenticated cookie to server for asynchronous request.

For GET and POST also same occuring...
0
Comment
Question by:Praveen_Bobbili
  • 5
  • 2
7 Comments
 
LVL 40

Expert Comment

by:gurvinder372
ID: 36494443
You can't post to the html file, since HTML will not be executed on the server. You need to use GET. If you want the cookie values to be processed on server, then you need to post it to server side script and also append the cookies name/value to the URL
0
 
LVL 1

Author Comment

by:Praveen_Bobbili
ID: 36501451
Even Ajax get request also failed to pass the authenticated WIF cookie
0
 
LVL 40

Expert Comment

by:gurvinder372
ID: 36501556
Pass to whom? HTML page? html page gets executed on client and client already have the cookies.
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 1

Author Comment

by:Praveen_Bobbili
ID: 36709561
No luck.....................
0
 
LVL 1

Author Comment

by:Praveen_Bobbili
ID: 38781668
No luck.....................
0
 
LVL 1

Accepted Solution

by:
Praveen_Bobbili earned 0 total points
ID: 38786227
$.ajax({
        type: "POST",
        url: "ajax/getCities.htm",
        dataType: "html",
               success: populateCityCountyFromSession
    });


Found the solution, by taking the url from the form tag issue solved. i found by goggling.
0
 
LVL 1

Author Closing Comment

by:Praveen_Bobbili
ID: 38800568
I hope this was the best solution i found
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
jQuery is a JavaScript library that greatly simplifies JavaScript programming. AJAX is an acronym formed from "Asynchronous JavaScript and XML."  AJAX refers to any communication between client and server, when the human client does not observe a…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now