Session contents lost despite Session.Timeout = 3000; and <sessionState mode="InProc" cookieless="f

Discussion in 'ASP .Net' started by Carpe Diem, Feb 20, 2004.

  1. Carpe Diem

    Carpe Diem Guest

    Hello I have an aspx page that loses Session("user") value after a few
    minutes even after I set
    <sessionState mode="InProc" cookieless="false" timeout="300"> in web.config
    and wrote
    function Session_Start() {
    Session.Timeout = 3000;
    }

    in global.asax

    Can you give me pointers on how to achieve the required functionality?

    --
    Jure Spik,
    Carpe Diem d.o.o., Kranj

    http://carpediem.si/
     
    Carpe Diem, Feb 20, 2004
    #1
    1. Advertising

  2. hi,
    that is not possible ..
    and no need to specify timeout to be 300.
    just 10 or 20 will do...

    try to find the exact reason why sessio is not mantained..

    plz send some snippet of code...


    --
    Thanks and Regards,

    Amit Agarwal
    Software Programmer(.NET)
    "Carpe Diem" <> wrote in message
    news:euHpJM%...
    > Hello I have an aspx page that loses Session("user") value after a few
    > minutes even after I set
    > <sessionState mode="InProc" cookieless="false" timeout="300"> in

    web.config
    > and wrote
    > function Session_Start() {
    > Session.Timeout = 3000;
    > }
    >
    > in global.asax
    >
    > Can you give me pointers on how to achieve the required functionality?
    >
    > --
    > Jure Spik,
    > Carpe Diem d.o.o., Kranj
    >
    > http://carpediem.si/
    >
    >



    ---
    Outgoing mail is certified Virus Free.
    Checked by AVG anti-virus system (http://www.grisoft.com).
    Version: 6.0.593 / Virus Database: 376 - Release Date: 2/20/2004
     
    .NET Follower, Feb 21, 2004
    #2
    1. Advertising

  3. I had a problem with session variables disappearing within one minute of
    being created at sites hosted by one web host. I got them to increase the
    Virtual memory limit on their application pools. That reduced recycling and
    increased session durations.


    ".NET Follower" <> wrote in message
    news:eCnwy4H%...
    > hi,
    > that is not possible ..
    > and no need to specify timeout to be 300.
    > just 10 or 20 will do...
    >
    > try to find the exact reason why sessio is not mantained..
    >
    > plz send some snippet of code...
    >
    >
    > --
    > Thanks and Regards,
    >
    > Amit Agarwal
    > Software Programmer(.NET)
    > "Carpe Diem" <> wrote in message
    > news:euHpJM%...
    > > Hello I have an aspx page that loses Session("user") value after a few
    > > minutes even after I set
    > > <sessionState mode="InProc" cookieless="false" timeout="300"> in

    > web.config
    > > and wrote
    > > function Session_Start() {
    > > Session.Timeout = 3000;
    > > }
    > >
    > > in global.asax
    > >
    > > Can you give me pointers on how to achieve the required functionality?
    > >
    > > --
    > > Jure Spik,
    > > Carpe Diem d.o.o., Kranj
    > >
    > > http://carpediem.si/
    > >
    > >

    >
    >
    > ---
    > Outgoing mail is certified Virus Free.
    > Checked by AVG anti-virus system (http://www.grisoft.com).
    > Version: 6.0.593 / Virus Database: 376 - Release Date: 2/20/2004
    >
    >
     
    William LaMartin, Feb 21, 2004
    #3
  4. Carpe Diem

    Carpe Diem Guest

    some code::
    list.aspx:: (this is the page that timeouts early)
    <%@ Page Language="JScript" debug='true' Strict="true" Explicit="true"
    Trace="false" enableSessionState="true" EnableViewState="true" Buffer="true"
    %>
    <script runat='server'>
    var user : String;

    function Page_Load(src : Object, e : EventArgs) {
    user = String(Session("loggedIn"));
    if (user == null || user == "null" || user == "" || user == "undefined") {
    Response.Redirect("mailing_login.aspx?authorised=no");
    Response.End();
    }
    //some data display
    }
    </script>
    <form runat='server'>
    <%=mailingListName%> subscribers:<br />
    <br />
    <span id="subscribersMsg" runat='server' /><br />
    <asp:DataList id='subscribers' runat='server'>
    <ItemTemplate>
    <a href='deleteSubscriber.aspx?subscriberId=<%#
    Int32(Container.DataItem("SubscriberID"))
    %>&amp;mailingListId=<%=mailingListID%>' onClick='return(confirm("Are you
    sure you want to delete subscriber <%#
    String(Container.DataItem("SubscriberEmail")) %> (no undo
    possible)?"));'>delete</a>
    <%# String(Container.DataItem("SubscriberEmail")) %><br />
    </ItemTemplate>
    </asp:DataList>
    </form>
    <input type='button' value='add subscriber' runat='server'>

    ----------------------------------------------------------------------------
    ---------------------------------------------------------

    mailing_login.aspx:: (login page)
    <%@ Page Language="JScript" debug='false' Strict="true" Explicit="true"
    Trace="false" EnableSessionState="true" EnableViewState="false"
    Buffer="true" %>

    <HTML>
    <head>
    <script language='JScript' runat='server'>
    function Page_Load() {
    if (Request.QueryString("authorised") != null) {
    Msg.Text = "You must login to access this site.<br />"
    }
    }
    function LoginBtn_Click(sender : Object, e : EventArgs) {
    //get user from database

    if (userFound) {
    Session("loggedIn") = UserName.Text;
    Response.Redirect("default.aspx");
    } else {
    Msg.Text += "Invalid Credentials: Please try again.<br />";
    }
    }
    </script>
    <form runat="server">
    <h2>Mailing List :: Login Page</h2>
    <hr size="1" />
    <table>
    <tr>
    <td>Username:</td>
    <td><asp:TextBox id="UserName" runat="server" /></td>
    <td><asp:RequiredFieldValidator id="userRequired" runat="server"
    ControlToValidate="UserName" Display="Static" ErrorMessage="Missing!"
    /></td>
    </tr>
    <tr>
    <td>Password:</td>
    <td><asp:TextBox id="UserPass" runat="server" TextMode="Password"
    /></td>
    <td><asp:RequiredFieldValidator id="passRequired" runat="server"
    ControlToValidate="UserPass" Display="Static" ErrorMessage="Missing!"
    /></td>
    </tr>
    </table>
    <asp:button id="LoginBtn" onclick="LoginBtn_Click" runat="server"
    text="Login" />
    <p><asp:Label id="Msg" runat="server" ForeColor="red" /></p>
    </form>

    </head>
    <body>
    </body>
    </HTML>


    --
    Jure Spik

    ".NET Follower" <> wrote in message
    news:eCnwy4H%...
    > hi,
    > that is not possible ..
    > and no need to specify timeout to be 300.
    > just 10 or 20 will do...
    >
    > try to find the exact reason why sessio is not mantained..
    >
    > plz send some snippet of code...
    >
    >
    > --
    > Thanks and Regards,
    >
    > Amit Agarwal
    > Software Programmer(.NET)
    > "Carpe Diem" <> wrote in message
    > news:euHpJM%...
    > > Hello I have an aspx page that loses Session("user") value after a few
    > > minutes even after I set
    > > <sessionState mode="InProc" cookieless="false" timeout="300"> in

    > web.config
    > > and wrote
    > > function Session_Start() {
    > > Session.Timeout = 3000;
    > > }
    > >
    > > in global.asax
    > >
    > > Can you give me pointers on how to achieve the required functionality?
    > >
    > > --
    > > Jure Spik,
    > > Carpe Diem d.o.o., Kranj
    > >
    > > http://carpediem.si/
    > >
    > >

    >
    >
    > ---
    > Outgoing mail is certified Virus Free.
    > Checked by AVG anti-virus system (http://www.grisoft.com).
    > Version: 6.0.593 / Virus Database: 376 - Release Date: 2/20/2004
    >
    >
     
    Carpe Diem, Feb 23, 2004
    #4
    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. --alec
    Replies:
    0
    Views:
    8,432
    --alec
    Jun 24, 2004
  2. MG
    Replies:
    2
    Views:
    1,803
  3. Replies:
    2
    Views:
    3,274
    Ravi Singh (UCSD)
    May 10, 2006
  4. April
    Replies:
    8
    Views:
    4,096
    April
    Jan 24, 2009
  5. feliz
    Replies:
    1
    Views:
    1,221
    John Saunders
    Aug 31, 2008
Loading...

Share This Page