SmartestVEGA
SmartestVEGA

Reputation: 8909

Session problem in asp.net website

I have an asp.net website, where there is no where session is implemented.

But i could see the session is timing out when i take the website after deploying in the production server ...

i checked the session entries in the web.config file... and searched session in the code..

nowhere i find the entry...

now i want to put a message box while session timeout ..how to do this..please help!!

Upvotes: 0

Views: 902

Answers (2)

Peter
Peter

Reputation: 38555

Put this in your aspx html code

<script language="javascript" type="text/javascript">
    setTimeout('SessionTimeout()', <%= Session.Timeout * 60 * 1000 %>);
    function SessionTimeout() {
        alert(<%= "'Session time out!!'" %>);
        window.location = "Default.aspx"
    }
</script>

Upvotes: 1

Muhammad Akhtar
Muhammad Akhtar

Reputation: 52241

you could check this in your web.config and increase time...

<sessionState timeout="20"></sessionState>

also check your sessionStatemode...

<sessionState mode="InProc"></sessionState>

Upvotes: 2

Related Questions