Welcome Guest, Not a member yet? Register   Sign In
Losing sessions with AJAX
#1

[eluser]Chris Williams[/eluser]
My sessions keep getting reset/lost every time I use AJAX on my web app. Following normal links has no issue, just with the AJAX functions.

I'm using jQuery for making calls to the server:
Code:
function ajaxMe(link) {
    $.ajax({
        type: "POST",
        url: link,
        data: "simple=true",
        success: function(html) {
            $("#ajaxView").html(html);
        }
    });        
};

$(".toggle").livequery(function() {
    $(this).click(function(){
        link = $(this).attr("href");
        ajaxMe(link);
        return false;
    });
});

Before I hop over to the jQuery support group, is there something I'm missing?
#2

[eluser]crumpet[/eluser]
have you tried $.post()
thats what i use and it works well
#3

[eluser]Chris Williams[/eluser]
I haven't. How would you use this for ajax?

--update--

Wait, I found a url about this.
http://docs.jquery.com/Ajax/jQuery.post

I'm not sure the best way to do this, but if this solves the session issue, awesome!




Theme © iAndrew 2016 - Forum software by © MyBB