Can't make session timeout

M

M O J O

Hi!

In the Web.config file I have this:

<sessionState mode="SQLServer" cookieless="false" timeout="1"
sqlConnectionString="data source=localhost;user
id=testuser;password=ds2k3os!93kjd>" />


In my Global.asax I have this:

Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs)
Session("test") = "Started - " & Now.ToString
End Sub


In my WebPage1 I have this:

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As_
System.EventArgs) Handles MyBase.Load

If Session.IsNewSession Then
Response.Write("New session!!!! <br><br>")
End If

Response.Write(Session.SessionID.ToString & "<br>" & _
Session("test").ToString & " .")

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As_
System.EventArgs) Handles Button1.Click
Label1.Text = Now.ToString
End Sub

Here's my question.....

When I start my application, the Session_Start event is fired.

If I leave my application running for a couple of minutes without
touching the keyboard and then click button1, I expect the Session_Start
event to be fired again, but it's not.

It seams like the session does not timeout.

What am I doing wrong here?

Thanks!!!!!!!!!!!!!

M O J O
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,710
Latest member
bernietqt

Latest Threads

Top