?
Solved

Session Time Out Problem

Posted on 2014-04-18
9
Medium Priority
?
382 Views
Last Modified: 2014-04-24
We are using Cookies Mode for Session State (IIS 7) and we have the time-out session set to 200 minutes but it is still timing out on our Intranet every 20 minutes or so. Below is the coding for the cookie.

Any help resolving this would be greatly appreciated.

Dim RememberCookie As New HttpCookie("DWMARemember")
        Dim UsernameCookie As New HttpCookie("DWMAUserName")
        Dim PasswordCookie As New HttpCookie("DWMAPassword")
        Dim AccessLevelCookie As New HttpCookie("DWMAAccess")
        Dim dt As DateTime = DateTime.Now
        Dim ts As New TimeSpan(30, 0, 0, 0)

        Dim Usuario As New DWMAUser()

        Usuario.UserName = txtUserName.Text
        Usuario.Password = txtPassword.Text

        If Usuario.Authenticate Then
            If chkRememberMe.Checked Then
                RememberCookie.Value = "y"
                RememberCookie.Expires = Date.Today.AddMonths(1)
                UsernameCookie.Value = Usuario.UserName
                UsernameCookie.Expires = Date.Today.AddMonths(1)
                PasswordCookie.Value = Usuario.Password
                PasswordCookie.Expires = Date.Today.AddMonths(1)
                AccessLevelCookie.Value = Usuario.UserLevel
                AccessLevelCookie.Expires = Date.Today.AddMonths(1)
                Response.Cookies.Add(RememberCookie)
                Response.Cookies.Add(UsernameCookie)
                Response.Cookies.Add(PasswordCookie)
                Response.Cookies.Add(AccessLevelCookie)
            End If
            Session("sDWMAFirstName") = Usuario.FirstName
            Session("sDWMALastName") = Usuario.LastName
            Session("sDWMANickName") = Usuario.NickName
            Session("sDWMAUserLevel") = Usuario.UserLevel

            FormsAuthentication.RedirectFromLoginPage(Usuario.UserName, chkRememberMe.Checked)
        Else
            lblError.Text = "Wrong user id or password. Please try again."
        End If
    End Sub
End Class
0
Comment
Question by:regsamp
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
9 Comments
 
LVL 13

Assisted Solution

by:Jitendra Patil
Jitendra Patil earned 1000 total points
ID: 40010040
as by its nature session will expire after 20 minutes.
please refer the below link to configure the setting in IIS
Configure Use Cookies Mode for Session State (IIS 7)
Session timeout problem in IIS7
hope this helps.
0
 

Author Comment

by:regsamp
ID: 40010703
I have changed the Session State time and it does not matter what I change it to, it will still always time out after 20 minutes.
0
 
LVL 7

Expert Comment

by:Utkarsh Kulkarni
ID: 40014296
Are you using FormsAuthentication ?
If yes, check the time value for FormsAuthentication Ticket in config.

Also, there are 3 ways where you can set session timeout
1. In IIS
2. In Web.config
& 3. Global.asax

Set this value at all three places and then check.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:regsamp
ID: 40014658
"Also, there are 3 ways where you can set session timeout
1. In IIS
2. In Web.config
& 3. Global.asax

Set this value at all three places and then check."

We have set the value to 300 minutes in all of these locations and after 20 minutes of inactivity, the user will always have to log back on.
0
 
LVL 7

Expert Comment

by:Utkarsh Kulkarni
ID: 40014718
What is FormAuthentication timeout value ?
0
 

Author Comment

by:regsamp
ID: 40015453
It is 300. We might have found the issue. We restarted IIS after the setting changes but it looks like the process was still running. We had to kill the process and the setting changes might have stuck now. We are monitoring.
0
 
LVL 7

Accepted Solution

by:
Utkarsh Kulkarni earned 1000 total points
ID: 40015589
ok. also restart the application pool.
0
 

Author Comment

by:regsamp
ID: 40015636
Okay, I will do that too
0
 

Author Comment

by:regsamp
ID: 40020550
Restarting all the services seemed to be the issue. Thank you for the help.
0

Featured Post

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question