Patrick
Patrick

Reputation: 2577

Will coldfusion correctly use sessions with AJAX?

If I'm doing an AJAX call from a coldfusion page (to another coldfusion page), will coldfusion correctly use sessions? I can't use cookies this way, right? The two pages would have separate application.cfc/cfm pages.

Upvotes: 0

Views: 267

Answers (2)

Brad Wood
Brad Wood

Reputation: 3953

When your browser makes an HTTP request to a server, it will send all cookies for that domain in the headers regardless of whether it is a "normal" request or an Ajax request. The user will have whatever session on the target site that they would normally have if they were hitting a page from that site by typing its URL in the address bar.

Upvotes: 2

Henry
Henry

Reputation: 32885

Different applications (appliaction.cfc/cfm) have different session management. Therefore, even if your ajax request carries the cfid/cftoken in the cookie, which it will, the destination cf application would not be able to access the session on the origin cf app.

Upvotes: 7

Related Questions