Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. no ajax call after the session remove

no ajax call after the session remove

Scheduled Pinned Locked Moved ASP.NET
debugginghelpasp-netsysadminsecurity
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Pankaj Saha
    wrote on last edited by
    #1

    hi, I have two MVC applications. I go to the MVC2 application from MVC1 application, I pass a token. When the MVC2 applications is loaded, its fetch the token and create the session. There are two button Logout and Save. I open MVC2 application in a IE browser and open the same application on the another tab. I just click the Logout button, which deletes all the sessions of the MVC2 application. Then I go to the first tab and click on the save button. Before saving the data, I simply check whether the session is exist or not, If session is exist then it will save the data otherwise redirect to the MVC1 application. But when I click on the Save button its shows the error "This page is accessing information that is not under its control. This proses a security risk. Do you want to continue?" I have used following code to check the session in the save button

    btnSave.bind("click", function(event) {

        isSessionActive();
    
        SaveData()
    

    }

    function isSessionActive() {
    $.ajax({
    url: "http://localhost/Home/IsSessionActive",
    type: "POST",
    data: {},
    success: function(result) {
    if (result !== "True") {

                window.location = "http://MVC1/Home";
    
            }
        }
    });
    

    }

    The server side code of IsSessionActive is public bool IsSessionActive() { if (Session == null || Session["AuthorizedToken"] == null) { return false; } return true; } I have also put the debugger point in the IsSessionActive function, but after logout it does not debug. It show the same message. Does anyone have any idea, how to resolve this problem. :confused:

    Pankaj

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups