Solved

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

Posted on 2011-09-07
7
411 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

751 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