urgent: session timeout occurs unexpectedly


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: urgent: session timeout occurs unexpectedly

  1. #1
    Join Date
    Oct 2005
    Posts
    3

    urgent: session timeout occurs unexpectedly

    I am doing a website with asp.net. i have used session variable in my global.asax file. the code is given below:

    Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs)
    Session.Timeout = 100
    Session("Loggedin") = "No"
    End Sub

    Sub Session_End(Sender As Object, E As EventArgs)
    ' Code that runs when a session ends

    Session.Abandon()
    Response.Redirect("index.aspx")
    End Sub

    And in webconfig i have used the following information inside <system.web> tag :

    <sessionState mode="InProc"
    cookieless="false"
    timeout="120"/>

    <pages buffer="false"
    enableSessionState="true"
    smartNavigation="false"
    autoEventWireup="true"
    validateRequest="false"
    enableViewStateMac = "false"
    enableViewState="true"/>

    Even after using these things when i login suddenlt after a min i am logged out though i am adding records at the moment.
    Please please tell me where i am going wrong. I have to give this project to my boss soon and i am stuck here since i am not

    able find out the problem why the session expires and i am logged out and send back to the login page.
    Seema

    (Mail ID: gaur.seema at rediffmail.com)

  2. #2
    Join Date
    Jan 2006
    Posts
    1

    Thumbs up

    trying making the your sessionState tag in the web.config look something like this:

    <sessionState
    mode="InProc"
    stateConnectionString="tcpip=127.0.0.1:42424"
    sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes"
    cookieless="false"
    timeout="120"
    />

    "stateConnectionString="tcpip=127.0.0.1:42424" will make the server able to track your sessions and manage them


    tell me if it works !
    Good luck
    Last edited by yasserhy; 01-26-2006 at 11:59 AM.

Similar Threads

  1. Replies: 12
    Last Post: 02-07-2012, 01:34 PM
  2. Why Session timeout does't work?.
    By srikan11 in forum ASP.NET
    Replies: 9
    Last Post: 05-30-2008, 05:23 PM
  3. Session Timeout
    By Pam in forum ASP.NET
    Replies: 2
    Last Post: 08-02-2002, 12:44 PM
  4. Preventing Session TimeOut
    By Alejandro Beltran in forum ASP.NET
    Replies: 1
    Last Post: 01-31-2002, 08:15 AM
  5. Session and timeout in ASP
    By john in forum ASP.NET
    Replies: 3
    Last Post: 09-15-2001, 04:52 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center