Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2011-09-07
7
Medium Priority
?
415 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:Gurvinder Pal Singh
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:Gurvinder Pal Singh
ID: 36501556
Pass to whom? HTML page? html page gets executed on client and client already have the cookies.
0
Independent Software Vendors: 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

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…
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…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

670 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