Re: Losing session values

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hi Steven,

I saw your response to Adrian, and I actually have the same problem: the
session does not save state, to be more specific, it reaches session_end
after postback or after redirecting to another function.

>From my debugging, I found out that the session reaches the session_end only
in a specific scenario that I run.

I'm calling, in remoting, to a function in my server side to return a
dataset.

This function in, the server, creates a new thread to run the query on the
database and retrieve the data and than return the dataset.

Now, if I comment out, still in the server, the code that performs the new
thread and perform the actual query, and instead I return null, the
session_end does not reach and the session does not end!

Do you have any idea?

"Adrian Parker" <apparker@xxxxxxxxxxxxx> wrote in message
news:eo6YQAB8FHA.2608@xxxxxxxxxxxxxxxxxxxxxxx
> Steven,
>
> I've attached the sesstest app that I used to test the problem as well as
> the trace result.
>
> I've now found out that on site, none of the clients work, but when the
> application is run from the server, it works ok. The server is running
> windows 2003.
>
> Thanks
> Adrian Parker
>
> "Steven Cheng[MSFT]" <stcheng@xxxxxxxxxxxxxxxxxxxx> wrote in message
> news:P2CGcv%236FHA.3648@xxxxxxxxxxxxxxxxxxxxxxxx
>> Thanks for your response Adrian,
>>
>> So the problem application is on a remote product server rather than your
>> local dev machine? That'll make the test more difficult. Anyway, please
>> feel free to post here when you got any new finding.
>>
>> Regards,
>>
>> Steven Cheng
>> Microsoft Online Support
>>
>> Get Secure! www.microsoft.com/security
>> (This posting is provided "AS IS", with no warranties, and confers no
>> rights.)
>> --------------------
>> | From: "Adrian Parker" <apparker@xxxxxxxxxxxxx>
>> | References: <em1Hub06FHA.2384@xxxxxxxxxxxxxxxxxxxx>
>> <XFhMaC46FHA.1236@xxxxxxxxxxxxxxxxxxxxx>
>> | Subject: Re: Losing session values
>> | Date: Thu, 17 Nov 2005 15:40:14 -0000
>> | Lines: 114
>> | X-Priority: 3
>> | X-MSMail-Priority: Normal
>> | X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
>> | X-RFC2646: Format=Flowed; Original
>> | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
>> | Message-ID: <ORsa3046FHA.2576@xxxxxxxxxxxxxxxxxxxx>
>> | Newsgroups: microsoft.public.dotnet.framework.aspnet
>> | NNTP-Posting-Host: 82-37-128-226.cable.ubr01.telf.blueyonder.co.uk
>> 82.37.128.226
>> | Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP09.phx.gbl
>> | Xref: TK2MSFTNGXA02.phx.gbl
>> microsoft.public.dotnet.framework.aspnet:358932
>> | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
>> |
>> |
>> | mode="InProc"
>> | stateConnectionString="tcpip=127.0.0.1:42424"
>> | sqlConnectionString="data source=127.0.0.1;user id=sa;password="
>> | cookieless="false"
>> | timeout="20"
>> |
>> | I will create a test website for them to try turning tracing on.
>> (they're
>> | in AU so it will be awhile until they reply)
>> |
>> |
>> | "Steven Cheng[MSFT]" <stcheng@xxxxxxxxxxxxxxxxxxxx> wrote in message
>> | news:XFhMaC46FHA.1236@xxxxxxxxxxxxxxxxxxxxxxxx
>> | > Hi Adrian,
>> | >
>> | > Welcome to ASPNET newsgroup.
>> | > From your description, in one of your ASP.NET 1.1 web application,
>> you
>> | > found that the sessionstate data stored will lose after post back or
>> | > redirect to new page, yes?
>> | >
>> | > As for the SessionState, we have several Modes, are you using InProc
>> | > session or other out Proc session, would you provide the
>> sessionState's
>> | > configure element? Also, to make sure that we're storing and
>> retrieving
>> | > value from the same Session, I suggest you turn on the Page's Ouput
>> Trace
>> | > through @page Directive like:
>> | >
>> | > <%@ Page Trace="True"....%>
>> | >
>> | > Then, the page will render the Cookie collection in the output. Also,
>> the
>> | > SessionId should be one of the cookie items. You can trace this Id to
>> see
>> | > whether remains the same between post back or page redirection.
>> Generally
>> | > for ASP.NET it'll use a random sessionid for each request if there is
>> no
>> | > sessionState data in use, however, after the certain client user
>> first
>> | > time
>> | > store some data into SessionState, the id should be fixed and unique
>> until
>> | > it timeout....
>> | >
>> | > Thanks,
>> | >
>> | > Steven Cheng
>> | > Microsoft Online Support
>> | >
>> | > Get Secure! www.microsoft.com/security
>> | > (This posting is provided "AS IS", with no warranties, and confers no
>> | > rights.)
>> | >
>> | >
>> | >
>> | >
>> | >
>> | >
>> | > --------------------
>> | > | From: "Adrian Parker" <apparker@xxxxxxxxxxxxx>
>> | > | Subject: Losing session values
>> | > | Date: Thu, 17 Nov 2005 07:09:37 -0000
>> | > | Lines: 37
>> | > | X-Priority: 3
>> | > | X-MSMail-Priority: Normal
>> | > | X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
>> | > | X-RFC2646: Format=Flowed; Original
>> | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
>> | > | Message-ID: <em1Hub06FHA.2384@xxxxxxxxxxxxxxxxxxxx>
>> | > | Newsgroups: microsoft.public.dotnet.framework.aspnet
>> | > | NNTP-Posting-Host: 82-37-128-226.cable.ubr01.telf.blueyonder.co.uk
>> | > 82.37.128.226
>> | > | Path:
>> TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
>> | > | Xref: TK2MSFTNGXA02.phx.gbl
>> | > microsoft.public.dotnet.framework.aspnet:358824
>> | > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
>> | > |
>> | > | We have a website that works everywhere but on a few PCs on this
>> one
>> | > site..
>> | > |
>> | > | Asp.Net 1.1
>> | > | Server = Windows 2003
>> | > | Client = XP
>> | > | In the web.config we use - cookieless="false"
>> | > | in the browser settings they have "Always allow session cookies"
>> set
>> to
>> | > true
>> | > |
>> | > | When the browser connects to the website the first page sets a
>> session
>> | > | variable called "user_ref" to something and then calls another
>> page.
>> If
>> | > on
>> | > | that new page we do the following piece of code:-
>> | > |
>> | > | Dim strRep As String = ""
>> | > | If Session.IsNewSession = True Then
>> | > | strRep = "Session is new."
>> | > | Else
>> | > | strRep = "Session is not new."
>> | > | End If
>> | > | If Session("user_ref") Is Nothing Then
>> | > | strRep += "Cookie is lost."
>> | > | Else
>> | > | strRep += "Cookie is active."
>> | > | End If
>> | > | TextBox1.Text = strRep
>> | > |
>> | > | We get
>> | > |
>> | > | Session is new.Cookie is lost.
>> | > |
>> | > | What could be causing this ?
>> | > |
>> | > | Thanks
>> | > | Adrian Parker
>> | > |
>> | > |
>> | > |
>> | > |
>> | > |
>> | >
>> |
>> |
>> |
>>
>
>
>


.



Relevant Pages

  • Re: Event ID 538 Logon Type 3 NT AUTHORITY/ANONYMOUS LOGON
    ... Here's what I know now that I didn't prior to your response -- ... Your version of the 'null session' command has two less ""s in it. ... Browser' service disabled on the server, ... If your server does not need to logon ...
    (microsoft.public.win2000.security)
  • F1: US GP: Spyker Friday practice notes
    ... productive first day of the US Grand Prix, ... Christijan Albers and Adrian Sutil finished just two seconds off ... Christijan and Adrian put in 28 and 27 laps respectively in the first ... session as they focussed on tyre and set-up evaluation. ...
    (rec.autos.sport.info)
  • Adrian:Are you really sure that you can make the non-genuine copie
    ... Adrian has joined this session! ... Connected with Adrian ... Welcome to Microsoft Customer Service Chat. ... It is against Microsoft policies and you will be in trouble. ...
    (microsoft.public.office.developer.vba)
  • Re: How many mpg ...
    ... Adrian wrote: ... for a session. ... fuel than the Land Rover Defender. ...
    (uk.transport)
  • Re: Broadband on a second PC ??
    ... Adrian wrote: ... as it is common for any 'Session ID' to be allocated to your session, ... BELKIN F5D5050 USB 10/100 ETHERNET ADAPTER ...
    (uk.telecom.broadband)