[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.aspnet.webservices

Get Access to other Session environment!

Manni

1/7/2003 9:43:00 PM

Sessionstate is managed (if so configured) by a cookie wich holds the
SessionID.
The webserver (framework) checks the cookie, an sets the session in my
environment.

So depending on the cookie I can access sessionbased values.

So far so good.

Now my problem: I have a client (.NET CF) wich is not supporting
CookieContext to hold that cookie.
The idea - I send the SessionID back as the result of a WS call.

The next function the client calls sends the SessionID back as a parameter.

So what I need is to set the environment to the SessionScope of that
SessionID.

Does anyone know how to do this???

I know, that I can use other mechanismns (DB or so on), but I have clients
wich are able to
use SessionCookies!

So the easiest was is to keep the things (a lot of WS functions) like they
are an write a nice litte wrapper.
Something like this:

void Func1(long lX) {
long lTmp;
lTmp=(long)Session["MyStoredVal"]; //better check for null and so
on.....
Session["MyStoredVal"]=InternalFunc(lX,lTmp);
........
}

The wrapper something like this:

void NoCookieFunc1(string strSessionIDFromEarlyerCall,long lX) {
Session.SetToThisState(strSessionIDFromEarlyerCall);
Func1(lX);
}

I hope this shows what I mean, and somebody knows how to implement
"Session.SetToThisState"!

Manfred





1 Answer

Mark Bower [MSFT]

1/8/2003 10:47:00 AM

0

ASP.NET supports cookieless session management through a simple
configuration setting. In your web.config try altering the <sessionstate>
element's cookieless attribute to a value of true.

e.g.
<configuration>
<sessionstate
mode="inproc"
cookieless="true"
timeout="20"
sqlconnectionstring="data source=127.0.0.1;user id=sa;password="
server="127.0.0.1"
port="42424"
/>
</configuration>

Does this help in your scenario?

--

Mark Bower
Microsoft

This posting is provided "AS IS" with no warranties, and confers no rights.
"Manni" <pcpohler@hotmail.com> wrote in message
news:#zWEm1otCHA.2308@TK2MSFTNGP09...
> Sessionstate is managed (if so configured) by a cookie wich holds the
> SessionID.
> The webserver (framework) checks the cookie, an sets the session in my
> environment.
>
> So depending on the cookie I can access sessionbased values.
>
> So far so good.
>
> Now my problem: I have a client (.NET CF) wich is not supporting
> CookieContext to hold that cookie.
> The idea - I send the SessionID back as the result of a WS call.
>
> The next function the client calls sends the SessionID back as a
parameter.
>
> So what I need is to set the environment to the SessionScope of that
> SessionID.
>
> Does anyone know how to do this???
>
> I know, that I can use other mechanismns (DB or so on), but I have clients
> wich are able to
> use SessionCookies!
>
> So the easiest was is to keep the things (a lot of WS functions) like they
> are an write a nice litte wrapper.
> Something like this:
>
> void Func1(long lX) {
> long lTmp;
> lTmp=(long)Session["MyStoredVal"]; //better check for null and so
> on.....
> Session["MyStoredVal"]=InternalFunc(lX,lTmp);
> ........
> }
>
> The wrapper something like this:
>
> void NoCookieFunc1(string strSessionIDFromEarlyerCall,long lX) {
> Session.SetToThisState(strSessionIDFromEarlyerCall);
> Func1(lX);
> }
>
> I hope this shows what I mean, and somebody knows how to implement
> "Session.SetToThisState"!
>
> Manfred
>
>
>
>
>