Groups | Blog | Home
all groups > c# > february 2008 >

c# : Asp.Net Sessions and Web Services


james
2/13/2008 10:13:11 PM
Hey Guys,

I am working on a RIA that uses Flex backed by Asp.Net Web Services,
and I am not sure how to manage user sessions. I have used sessions
in Asp.Net before, but I haven't figured out how to plug my web
service calls into Asp.Net's mechanism, or what the plumbing would
look like to pass the session info back and forth from flex. I don't
feel like I have a good understanding of this (like security
implications, etc). Any comments or pointers in the right direction
are appreciated.

Thanks!
Alberto Poblacion
2/14/2008 4:24:43 PM
[quoted text, click to view]

From the point of view of the asp.net web service, you have to enable
sessions (which are disabled by default for web services) in the WebMethod
attribute:

[ WebMethod(EnableSession=true) ]
public void MyMethod(...)
{
...
}

For this to work, the client of the web service needs to accept the
Session Cookie and send it back to the server on each request. If the client
were a .Net application, you would achieve this by means of a
CookieContainer object that you would add to your proxy class. However, I do
not know how to do an equivalent operation with Flex. You would get better
responses to this part in an Adobe forum, rather than a C# one.
AddThis Social Bookmark Button