Saturday, March 24, 2012

Site logging me out automatically !?

I have come across this weird problem. My website identifies user through windows login when he/she enters and keeps the username in session for functions like displaying files added since last login. Now, I have a search page on my website and whenever a user searches for some doucments throught that page, it automatically logs user out , meaning that you have to go to main page again so the system can log you in again...I have exhausted all options and cannot understand why this happens...Any help or guidance will be greatly appreciated.

Below is the code for my Page_Load of "search form".... I am not sure but I think problem has to do with some code in it...

Sub Page_Load(Source As Object, E As EventArgs)
Response.BufferOutput = "True"
If Len(Request("search")) > 0 Or Len(Request("subField")) > 0 Then
If Len(Request("search")) > 0 Then Session.Clear()
MyDataGrid.CurrentPageIndex = 0 ' resets the Datagrid to page 1
BindGrid()
subsrch.visible = "true"

Else
subsrch.visible = "false"
End If

End Sub

Are you physically searching the hard disk, not a database?

If the web.config gets touched, you will lose your session information.
No, I am searching a database.
I think the reason might be Session.Clear () statement in the code I posted but I thought that Session.Clear() only clears session information on the page it is invoked on...Any idea about the validity of this theory ?

Thanks again.

0 comments:

Post a Comment