Session Variables in IIS

Discussion in 'ASP General' started by Brian Brinks, Sep 22, 2005.

  1. Brian Brinks

    Brian Brinks Guest

    I am having some trouble with seesion variables.

    I have just moved hosting companies to Brinkster.com but have been
    having problems with my applications holding session.

    They say they can't guarantee sessions and recomend another method of
    storing persistant data.

    I questioned them on why, only on their servers, my sessions are being
    reset as often as they are. They said it must be a coding issue.
    However, I have not had trouble before, with same applications on
    different or local servers.

    So my question is this, what can reset session data? Just a reset of
    iis?
     
    Brian Brinks, Sep 22, 2005
    #1
    1. Advertising

  2. Brian Brinks

    Evertjan. Guest

    Brian Brinks wrote on 22 sep 2005 in
    microsoft.public.inetserver.asp.general:

    > I am having some trouble with seesion variables.
    >
    > I have just moved hosting companies to Brinkster.com but have been
    > having problems with my applications holding session.
    >
    > They say they can't guarantee sessions and recomend another method of
    > storing persistant data.
    >
    > I questioned them on why, only on their servers, my sessions are being
    > reset as often as they are. They said it must be a coding issue.
    > However, I have not had trouble before, with same applications on
    > different or local servers.
    >
    > So my question is this, what can reset session data? Just a reset of
    > iis?
    >
    >


    Please show us the smallest code where this phenomenon happens.

    --
    Evertjan.
    The Netherlands.
    (Replace all crosses with dots in my emailaddress)
     
    Evertjan., Sep 22, 2005
    #2
    1. Advertising

  3. Brian Brinks

    Brian Brinks Guest

    Here is a code sample - It is basically very simple - just gettin some
    data from a db and displaying it in a dropdown:

    Function displayCompanies()
    dim arrCompanies,i
    arrCompanies = DB_ExecuteSQLReturnArray("SELECT * FROM t_company order
    by t_company.company")
    if ISarray(arrCompanies) = TRUE then
    %><div align=center>
    <form name="companyidd" method="post"
    action="home.asp?action=companydata">
    <select name="select"
    onchange="window.open(this.options[this.selectedIndex].value,'_top')">
    <option>Companies</option>
    <option>-----------------------</option>
    <%
    for i=0 to ubound(arrCompanies,2)
    %><option
    value="home.asp?action=companydata&cid=<%=arrCompanies(0,i)%>"><%=arrCompanies(1,i)%></option><%
    next
    %>
    </select><br>
    <br>
    <!--<input type="submit" name="Submit" value="Submit">-->
    </form></div><%
    end if
    end function
     
    Brian Brinks, Sep 22, 2005
    #3
  4. "Brian Brinks" <> wrote in message
    news:...
    >I am having some trouble with seesion variables.
    >
    > I have just moved hosting companies to Brinkster.com but have been
    > having problems with my applications holding session.


    That's true. If an application is reset or if you are using a web farm you
    can't garantuee your session.
    Happily, there are good products such as below to solve this.
    ISP Session is one of the best compatible with asp and asp.net (version 5.2
    is being built to allow even better integration with .NET)

    --
    compatible web farm Session replacement for Asp and Asp.Net
    http://www.nieropwebconsult.nl/asp_session_manager.htm


    > They say they can't guarantee sessions and recomend another method of
    > storing persistant data.
    >
    > I questioned them on why, only on their servers, my sessions are being
    > reset as often as they are. They said it must be a coding issue.
    > However, I have not had trouble before, with same applications on
    > different or local servers.
    >
    > So my question is this, what can reset session data? Just a reset of
    > iis?
    >
     
    Egbert Nierop \(MVP for IIS\), Sep 22, 2005
    #4
  5. Brian Brinks

    Evertjan. Guest

    Brian Brinks wrote on 22 sep 2005 in
    microsoft.public.inetserver.asp.general:

    > Here is a code sample - It is basically very simple - just gettin some
    > data from a db and displaying it in a dropdown:
    >
    > Function displayCompanies()
    > dim arrCompanies,i
    > arrCompanies = DB_ExecuteSQLReturnArray("SELECT * FROM t_company
    > order
    > by t_company.company")
    > if ISarray(arrCompanies) = TRUE then
    > %><div align=center>
    > <form name="companyidd" method="post"
    > action="home.asp?action=companydata">
    > <select name="select"
    > onchange="window.open(this.options[this.selectedIndex].value,'_top')">
    > <option>Companies</option>
    > <option>-----------------------</option>
    > <%
    > for i=0 to ubound(arrCompanies,2)
    > %><option
    > value="home.asp?action=companydata&cid=<%=arrCompanies(0,i)%>"><%=arrCo
    > mpanies(1,i)%></option><%
    > next
    > %>
    > </select><br>
    > <br>
    > <!--<input type="submit" name="Submit" value="Submit">-->
    > </form></div><%
    > end if
    > end function
    >


    You are not quoting your question, but I suppose you lost your session
    variable?

    I do not see a session variable in your code.

    --
    Evertjan.
    The Netherlands.
    (Replace all crosses with dots in my emailaddress)
     
    Evertjan., Sep 22, 2005
    #5
  6. Hi Brian,


    Did somebody configure IIS on Win2003 to utilize a web garden? If so, this
    is logical. You can't share sessions among a wegb garden without jumping to
    external tools since MS does not support sessions for that purpose.

    --
    compatible web farm Session replacement for Asp and Asp.Net
    http://www.nieropwebconsult.nl/asp_session_manager.htm

    "Brian Brinks" <> wrote in message
    news:...
    >I am having some trouble with seesion variables.
    >
    > I have just moved hosting companies to Brinkster.com but have been
    > having problems with my applications holding session.
    >
    > They say they can't guarantee sessions and recomend another method of
    > storing persistant data.
    >
    > I questioned them on why, only on their servers, my sessions are being
    > reset as often as they are. They said it must be a coding issue.
    > However, I have not had trouble before, with same applications on
    > different or local servers.
    >
    > So my question is this, what can reset session data? Just a reset of
    > iis?
    >
     
    Egbert Nierop \(MVP for IIS\), Sep 23, 2005
    #6
  7. Brian Brinks

    Prabhat Guest

    Hi,

    I have one small question on Session. How do I know from which link my
    webpage is clicked (like is that from Google ot from with in the same main
    page).

    I know about Request.ServerVariables("HTTP_REFERER"). So I used this in
    "global.asa" file in "Session_OnStart" event like this:

    Sub Session_OnStart
    Session("ReferralURL") = Request.ServerVariables("HTTP_REFERER")
    End Sub

    Sub Session_OnEnd
    Session("ReferralURL") = ""
    End Sub

    So that I can use the session variable any where in my website, because the
    HTTP_REFERER will give the URL of the last webpage.

    But this seems to not working.

    Thanks
    PN

    "Egbert Nierop (MVP for IIS)" <> wrote in
    message news:...
    >
    > "Brian Brinks" <> wrote in message
    > news:...
    > >I am having some trouble with seesion variables.
    > >
    > > I have just moved hosting companies to Brinkster.com but have been
    > > having problems with my applications holding session.

    >
    > That's true. If an application is reset or if you are using a web farm you
    > can't garantuee your session.
    > Happily, there are good products such as below to solve this.
    > ISP Session is one of the best compatible with asp and asp.net (version

    5.2
    > is being built to allow even better integration with .NET)
    >
    > --
    > compatible web farm Session replacement for Asp and Asp.Net
    > http://www.nieropwebconsult.nl/asp_session_manager.htm
    >
    >
    > > They say they can't guarantee sessions and recomend another method of
    > > storing persistant data.
    > >
    > > I questioned them on why, only on their servers, my sessions are being
    > > reset as often as they are. They said it must be a coding issue.
    > > However, I have not had trouble before, with same applications on
    > > different or local servers.
    > >
    > > So my question is this, what can reset session data? Just a reset of
    > > iis?
    > >

    >
     
    Prabhat, Sep 23, 2005
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Marco Ippolito
    Replies:
    2
    Views:
    1,277
    Marco Ippolito
    Oct 5, 2004
  2. =?Utf-8?B?Um9iSEs=?=
    Replies:
    4
    Views:
    5,415
    =?Utf-8?B?Um9iSEs=?=
    Apr 11, 2007
  3. NewbieDev
    Replies:
    1
    Views:
    220
    NewbieDev
    Apr 25, 2006
  4. Mark P
    Replies:
    1
    Views:
    120
    Aaron Bertrand - MVP
    Sep 9, 2003
  5. Jim Boyer

    session variables disappear in IIS 6

    Jim Boyer, Oct 30, 2003, in forum: ASP General
    Replies:
    1
    Views:
    171
    Aaron Bertrand - MVP
    Oct 30, 2003
Loading...

Share This Page