ASP .NET and remote content assets


(Raena Armitage) #1

Hi,


I would like to use an ASP .NET application (it's been written by someone else) inside a Matrix remote content asset. It searches a catalogue of items and doesn't desperately need to be overly secure.



What's the best way to maintain state there while playing well with Matrix? I don't do ASP so I'm kind of clueless in that regard.



Thanks in advance for any advice!


(Avi Miller) #2

As far as I know, the Remote Content asset will maintain state for a user. Its worked that way with all the applications I've remote contented so far (i.e. there is already session cookie handling built into the Remote Content page).


(Raena Armitage) #3

Well, there's a couple of applications I've tried that don't go, and I don't know why this is so. It's hard to tell what, if anything, the application might be up to without being able to see the source, but they're not mine so I can't do much except twiddle with the settings at the Matrix end. They just don't post back the results of the search.


I'm still trying to get info from the developers about this, too, but in the meantime, is there anything you know of that would prevent a cookie or some other form of session management from working? I'm using the start-at-this-tag, stop-at-that-one settings (and checked it fairly thoroughly), and not tunnelling the remote content's media.


(Avi Miller) #4

What happens if you don't use start and end tags, and try and nest the entire content? For all the ASP.NET applications I've nested, I've yet to have a problem when submitting forms. Though, now I'm not sure if there is actually session stuff happening.


I'll prod the Remote Content asset's developer to poke his head in here.


(Andrei Railean) #5

There is one situation when ASP systems aren't properly 'remote-contentable'. The problem appears when images are used as form buttons. PHP and ASP interpret the coordinates submitted by the browser differently. if the image button is named 'test' (i.e. name="test"), when clicked PHP will see it's coordinates as 'test_x=X' and 'test_y=Y', while ASP will see it as 'test.x=X' and 'test.y=Y'.


Since remote content works by simply forwarding the request variables to the remote server, ASP script might not work as prescribed because it will expect 'test.x', but will not find it.



Unfortunately, Remote Content does not have a setting to solve this problem. This issue was just discovered and no solution has been attempted yet.


(Andrei Railean) #6

Also AJAX (heavy dynamic JavaScript) applications aren't properly remote-contentable. They rely on URL re-writes on-the-fly and most often don't rewrite the URLs to point back to the matrix system thus escaping from the Remote Content sandbox.


(Marcus Nyeholt) #7

Additionally, if the remote application uses sessions at all, it's not going to work as the session becomes owned by the matrix server (as it's proxying requests between the user and the remote app).


(Raena Armitage) #8

How about cookieless sessions (as in, when the session key is embedded in the URLs the application generates)? Nobody really needs to own it, then cause the session lives on the asp app's server.

[quote]What happens if you don't use start and end tags, and try and nest the entire content?[/quote]When the test box we're using comes back up I'll give that another go. :wink:


(Raena Armitage) #9

Well, I tried nesting all the content, as well as trimming it at <body>/</body> and a couple other places. Still no love with returning the results, though it does correctly postback the search term I entered.


But hey! Progress. Kinda. :smiley:


(Avi Miller) #10

Perhaps you should get one of the Squiz guys to troubleshoot this with you? :slight_smile:


(Raena Armitage) #11

I'll wait till they're done looking at our more scary issues. :wink:


Andrei: thanks for the tip about the images. It already seems responsible for at least one stuffup!


(Andrei Railean) #12

Any time, Raena!


Regarding Marcus' comment on sessions: It's not exactly correct. The cookies are maintained on the Matrix side and are given back to the remote server with each request. So unless your 'remote-contented' application relies on JS re-writing or getting/setting cookies, the SESSION ID will be maintained without a problem.



In fact there are 2 session IDs, one for the session between the web browser and the matrix, and another between Matrix and the remote system. Those sessions, obviously, have different IDs.


(Raena Armitage) #13

Thanks once more!


In the meantime, I have another small problem with character encodings – some characters in the embedded content come out as circumflexed A’s, etc. I tried explicitly setting utf-8 in a meta tag in my parsefile, but Firefox still reports that the Matrix page is being served as ISO-8859-1.



Is this anything I can change someplace in Matrix, preferably at the header level? I know Apache 2 likes to enforce an encoding onto pages that haven’t already got one in the header, and that will override my meta tag, but I can’t really change the Apache configuration on my own.
funkycharacters.gif (3.52 KB)


(Andrei Railean) #14

On the 'settings' screen for an asset there is a character set selector. You can select UTF-8 there.


(Raena Armitage) #15

Oh, sweet. of course it was right under my nose.


Thanks again!


(Pat Birgan) #16

Quick one - will remote content assets work with https:// addresses. We are having an issue with this. Bug or feature??!!!


(Aleks Bochniak) #17

Are you using self-signed certs?


(Avi Miller) #18

Remote Content does not work with HTTPS, as far as I know.

(Nic Hubbard) #19

We have tried it and we get errors. Although we don't have a certificate on the site that we are using to nest, but we do on the site that is being nested. So, maybe if we had it on both...

(Justin Cormack) #20

[quote]Any time, Raena!


Regarding Marcus' comment on sessions: It's not exactly correct. The cookies are maintained on the Matrix side and are given back to the remote server with each request. So unless your 'remote-contented' application relies on JS re-writing or getting/setting cookies, the SESSION ID will be maintained without a problem.



In fact there are 2 session IDs, one for the session between the web browser and the matrix, and another between Matrix and the remote system. Those sessions, obviously, have different IDs.[/quote]



We have ended up with session issues with some applications that we have had to patch the cookie handling code. But most of the time it just works.



Working through web services APIs and doing the rendering in Matrix can end up giving a cleaner solution.