Solved

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

Posted on 2011-09-07
7
413 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
Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

 
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

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
The most up-to-date version of this article is on my Blog https://iconoun.com/blog/
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

630 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