How to set session timeout | | |
Setting session timeout in web.config file does not seem
to have any effect. Any explanation or suggestion will be
appreciated. | | | | re: How to set session timeout
That would be the way to do it.
What makes you think that it is not working?
"Geigho" <ighodaro@zeonchemicals.com> wrote in message
news:0a7501c34a25$55ed5b50$a501280a@phx.gbl...[color=blue]
> Setting session timeout in web.config file does not seem
> to have any effect. Any explanation or suggestion will be
> appreciated.[/color] | | | | re: How to set session timeout
That would be the way to do it.
What makes you think that it is not working?
"Geigho" <ighodaro@zeonchemicals.com> wrote in message
news:0a7501c34a25$55ed5b50$a501280a@phx.gbl...[color=blue]
> Setting session timeout in web.config file does not seem
> to have any effect. Any explanation or suggestion will be
> appreciated.[/color] | | | | re: How to set session timeout
I am using a form based login. It does not matter what
value I set timeout to (e.g timeout="1", timeout="20",
timeout="120", etc), the application always takes me back
to the login form after approximately 20 minutes of not
posting the page back to the server.
<sessionState mode="InProc"
stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data source=127.0.0.1;user
id=sa;password=" cookieless="true" timeout="1" />
[color=blue]
>-----Original Message-----
>That would be the way to do it.
>
>What makes you think that it is not working?
>
>"Geigho" <ighodaro@zeonchemicals.com> wrote in message
>news:0a7501c34a25$55ed5b50$a501280a@phx.gbl...[color=green]
>> Setting session timeout in web.config file does not[/color][/color]
seem[color=blue][color=green]
>> to have any effect. Any explanation or suggestion will[/color][/color]
be[color=blue][color=green]
>> appreciated.[/color]
>
>
>.
>[/color] | | | | re: How to set session timeout
I am using a form based login. It does not matter what
value I set timeout to (e.g timeout="1", timeout="20",
timeout="120", etc), the application always takes me back
to the login form after approximately 20 minutes of not
posting the page back to the server.
<sessionState mode="InProc"
stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data source=127.0.0.1;user
id=sa;password=" cookieless="true" timeout="1" />
[color=blue]
>-----Original Message-----
>That would be the way to do it.
>
>What makes you think that it is not working?
>
>"Geigho" <ighodaro@zeonchemicals.com> wrote in message
>news:0a7501c34a25$55ed5b50$a501280a@phx.gbl...[color=green]
>> Setting session timeout in web.config file does not[/color][/color]
seem[color=blue][color=green]
>> to have any effect. Any explanation or suggestion will[/color][/color]
be[color=blue][color=green]
>> appreciated.[/color]
>
>
>.
>[/color] | | | | re: How to set session timeout
forms authentication and session state are not related.
youre forms authentication timeout specifies how long after a period of
inactivity should the user be taken back to the login page.
Session state just says how long to maintain session data for. If the
session timeout is shorter then the authentication timeout, the session data
will dissapear, but the user will still be authenticated, and thus not be
asked to relog in.
"geigho" <ighodaro@zeonchemicals.com> wrote in message
news:020901c34a33$38136ad0$a301280a@phx.gbl...[color=blue]
> I am using a form based login. It does not matter what
> value I set timeout to (e.g timeout="1", timeout="20",
> timeout="120", etc), the application always takes me back
> to the login form after approximately 20 minutes of not
> posting the page back to the server.
>
> <sessionState mode="InProc"
> stateConnectionString="tcpip=127.0.0.1:42424"
> sqlConnectionString="data source=127.0.0.1;user
> id=sa;password=" cookieless="true" timeout="1" />
>[color=green]
> >-----Original Message-----
> >That would be the way to do it.
> >
> >What makes you think that it is not working?
> >
> >"Geigho" <ighodaro@zeonchemicals.com> wrote in message
> >news:0a7501c34a25$55ed5b50$a501280a@phx.gbl...[color=darkred]
> >> Setting session timeout in web.config file does not[/color][/color]
> seem[color=green][color=darkred]
> >> to have any effect. Any explanation or suggestion will[/color][/color]
> be[color=green][color=darkred]
> >> appreciated.[/color]
> >
> >
> >.
> >[/color][/color] | | | | re: How to set session timeout
forms authentication and session state are not related.
youre forms authentication timeout specifies how long after a period of
inactivity should the user be taken back to the login page.
Session state just says how long to maintain session data for. If the
session timeout is shorter then the authentication timeout, the session data
will dissapear, but the user will still be authenticated, and thus not be
asked to relog in.
"geigho" <ighodaro@zeonchemicals.com> wrote in message
news:020901c34a33$38136ad0$a301280a@phx.gbl...[color=blue]
> I am using a form based login. It does not matter what
> value I set timeout to (e.g timeout="1", timeout="20",
> timeout="120", etc), the application always takes me back
> to the login form after approximately 20 minutes of not
> posting the page back to the server.
>
> <sessionState mode="InProc"
> stateConnectionString="tcpip=127.0.0.1:42424"
> sqlConnectionString="data source=127.0.0.1;user
> id=sa;password=" cookieless="true" timeout="1" />
>[color=green]
> >-----Original Message-----
> >That would be the way to do it.
> >
> >What makes you think that it is not working?
> >
> >"Geigho" <ighodaro@zeonchemicals.com> wrote in message
> >news:0a7501c34a25$55ed5b50$a501280a@phx.gbl...[color=darkred]
> >> Setting session timeout in web.config file does not[/color][/color]
> seem[color=green][color=darkred]
> >> to have any effect. Any explanation or suggestion will[/color][/color]
> be[color=green][color=darkred]
> >> appreciated.[/color]
> >
> >
> >.
> >[/color][/color] | | | | re: How to set session timeout
Thanks! But how do you set forms authentication timeout?
If I saved authentication flag in a session variable and
the session timed out, is the variable still available?
If not, then won't this cause the login page to be
redisplay since the authentication code (logic) cannot
read the value set in the session variable?
[color=blue]
>-----Original Message-----
>forms authentication and session state are not related.
>
>youre forms authentication timeout specifies how long[/color]
after a period of[color=blue]
>inactivity should the user be taken back to the login[/color]
page.[color=blue]
>
>Session state just says how long to maintain session[/color]
data for. If the[color=blue]
>session timeout is shorter then the authentication[/color]
timeout, the session data[color=blue]
>will dissapear, but the user will still be[/color]
authenticated, and thus not be[color=blue]
>asked to relog in.
>
>"geigho" <ighodaro@zeonchemicals.com> wrote in message
>news:020901c34a33$38136ad0$a301280a@phx.gbl...[color=green]
>> I am using a form based login. It does not matter what
>> value I set timeout to (e.g timeout="1", timeout="20",
>> timeout="120", etc), the application always takes me[/color][/color]
back[color=blue][color=green]
>> to the login form after approximately 20 minutes of not
>> posting the page back to the server.
>>
>> <sessionState mode="InProc"
>> stateConnectionString="tcpip=127.0.0.1:42424"
>> sqlConnectionString="data source=127.0.0.1;user
>> id=sa;password=" cookieless="true" timeout="1" />
>>[color=darkred]
>> >-----Original Message-----
>> >That would be the way to do it.
>> >
>> >What makes you think that it is not working?
>> >
>> >"Geigho" <ighodaro@zeonchemicals.com> wrote in message
>> >news:0a7501c34a25$55ed5b50$a501280a@phx.gbl...
>> >> Setting session timeout in web.config file does not[/color]
>> seem[color=darkred]
>> >> to have any effect. Any explanation or suggestion[/color][/color][/color]
will[color=blue][color=green]
>> be[color=darkred]
>> >> appreciated.
>> >
>> >
>> >.
>> >[/color][/color]
>
>
>.
>[/color] | | | | re: How to set session timeout
Thanks! But how do you set forms authentication timeout?
If I saved authentication flag in a session variable and
the session timed out, is the variable still available?
If not, then won't this cause the login page to be
redisplay since the authentication code (logic) cannot
read the value set in the session variable?
[color=blue]
>-----Original Message-----
>forms authentication and session state are not related.
>
>youre forms authentication timeout specifies how long[/color]
after a period of[color=blue]
>inactivity should the user be taken back to the login[/color]
page.[color=blue]
>
>Session state just says how long to maintain session[/color]
data for. If the[color=blue]
>session timeout is shorter then the authentication[/color]
timeout, the session data[color=blue]
>will dissapear, but the user will still be[/color]
authenticated, and thus not be[color=blue]
>asked to relog in.
>
>"geigho" <ighodaro@zeonchemicals.com> wrote in message
>news:020901c34a33$38136ad0$a301280a@phx.gbl...[color=green]
>> I am using a form based login. It does not matter what
>> value I set timeout to (e.g timeout="1", timeout="20",
>> timeout="120", etc), the application always takes me[/color][/color]
back[color=blue][color=green]
>> to the login form after approximately 20 minutes of not
>> posting the page back to the server.
>>
>> <sessionState mode="InProc"
>> stateConnectionString="tcpip=127.0.0.1:42424"
>> sqlConnectionString="data source=127.0.0.1;user
>> id=sa;password=" cookieless="true" timeout="1" />
>>[color=darkred]
>> >-----Original Message-----
>> >That would be the way to do it.
>> >
>> >What makes you think that it is not working?
>> >
>> >"Geigho" <ighodaro@zeonchemicals.com> wrote in message
>> >news:0a7501c34a25$55ed5b50$a501280a@phx.gbl...
>> >> Setting session timeout in web.config file does not[/color]
>> seem[color=darkred]
>> >> to have any effect. Any explanation or suggestion[/color][/color][/color]
will[color=blue][color=green]
>> be[color=darkred]
>> >> appreciated.
>> >
>> >
>> >.
>> >[/color][/color]
>
>
>.
>[/color] | | | | re: How to set session timeout
You set this value in the constructor for the
FormsAuthenticationTicket as shown below. After your user
is authenticated, try something like the following:
FormsAuthenticationTicket tkt;
string CookieStr;
HttpCookie ck;
// Create new Auth Ticket. Last argument authentication
timeout expressed in seconds.
SessionTimeout = 30; //Timeout in minutes
tkt = new FormsAuthenticationTicket(txtUserName.Text,
false, SessionTimeout * 60);
// Encrypt ticket
CookieStr = FormsAuthentication.Encrypt(tkt);
// Create the cookie
ck = new HttpCookie(FormsAuthentication.FormsCookieName,
CookieStr);
//Add cookie to HTTP header
Response.Cookies.Add(ck);
// Redirect to the main page
Response.Redirect("Default.htm", true);
HTH.
J. Ptak
[color=blue]
>-----Original Message-----
>Thanks! But how do you set forms authentication timeout?
>If I saved authentication flag in a session variable and
>the session timed out, is the variable still available?
>If not, then won't this cause the login page to be
>redisplay since the authentication code (logic) cannot
>read the value set in the session variable?
>[color=green]
>>-----Original Message-----
>>forms authentication and session state are not related.
>>
>>youre forms authentication timeout specifies how long[/color]
>after a period of[color=green]
>>inactivity should the user be taken back to the login[/color]
>page.[color=green]
>>
>>Session state just says how long to maintain session[/color]
>data for. If the[color=green]
>>session timeout is shorter then the authentication[/color]
>timeout, the session data[color=green]
>>will dissapear, but the user will still be[/color]
>authenticated, and thus not be[color=green]
>>asked to relog in.
>>
>>"geigho" <ighodaro@zeonchemicals.com> wrote in message
>>news:020901c34a33$38136ad0$a301280a@phx.gbl...[color=darkred]
>>> I am using a form based login. It does not matter what
>>> value I set timeout to (e.g timeout="1", timeout="20",
>>> timeout="120", etc), the application always takes me[/color][/color]
>back[color=green][color=darkred]
>>> to the login form after approximately 20 minutes of not
>>> posting the page back to the server.
>>>
>>> <sessionState mode="InProc"
>>> stateConnectionString="tcpip=127.0.0.1:42424"
>>> sqlConnectionString="data source=127.0.0.1;user
>>> id=sa;password=" cookieless="true" timeout="1" />
>>>
>>> >-----Original Message-----
>>> >That would be the way to do it.
>>> >
>>> >What makes you think that it is not working?
>>> >
>>> >"Geigho" <ighodaro@zeonchemicals.com> wrote in message
>>> >news:0a7501c34a25$55ed5b50$a501280a@phx.gbl...
>>> >> Setting session timeout in web.config file does not
>>> seem
>>> >> to have any effect. Any explanation or suggestion[/color][/color]
>will[color=green][color=darkred]
>>> be
>>> >> appreciated.
>>> >
>>> >
>>> >.
>>> >[/color]
>>
>>
>>.
>>[/color]
>.
>[/color] | | | | re: How to set session timeout
You set this value in the constructor for the
FormsAuthenticationTicket as shown below. After your user
is authenticated, try something like the following:
FormsAuthenticationTicket tkt;
string CookieStr;
HttpCookie ck;
// Create new Auth Ticket. Last argument authentication
timeout expressed in seconds.
SessionTimeout = 30; //Timeout in minutes
tkt = new FormsAuthenticationTicket(txtUserName.Text,
false, SessionTimeout * 60);
// Encrypt ticket
CookieStr = FormsAuthentication.Encrypt(tkt);
// Create the cookie
ck = new HttpCookie(FormsAuthentication.FormsCookieName,
CookieStr);
//Add cookie to HTTP header
Response.Cookies.Add(ck);
// Redirect to the main page
Response.Redirect("Default.htm", true);
HTH.
J. Ptak
[color=blue]
>-----Original Message-----
>Thanks! But how do you set forms authentication timeout?
>If I saved authentication flag in a session variable and
>the session timed out, is the variable still available?
>If not, then won't this cause the login page to be
>redisplay since the authentication code (logic) cannot
>read the value set in the session variable?
>[color=green]
>>-----Original Message-----
>>forms authentication and session state are not related.
>>
>>youre forms authentication timeout specifies how long[/color]
>after a period of[color=green]
>>inactivity should the user be taken back to the login[/color]
>page.[color=green]
>>
>>Session state just says how long to maintain session[/color]
>data for. If the[color=green]
>>session timeout is shorter then the authentication[/color]
>timeout, the session data[color=green]
>>will dissapear, but the user will still be[/color]
>authenticated, and thus not be[color=green]
>>asked to relog in.
>>
>>"geigho" <ighodaro@zeonchemicals.com> wrote in message
>>news:020901c34a33$38136ad0$a301280a@phx.gbl...[color=darkred]
>>> I am using a form based login. It does not matter what
>>> value I set timeout to (e.g timeout="1", timeout="20",
>>> timeout="120", etc), the application always takes me[/color][/color]
>back[color=green][color=darkred]
>>> to the login form after approximately 20 minutes of not
>>> posting the page back to the server.
>>>
>>> <sessionState mode="InProc"
>>> stateConnectionString="tcpip=127.0.0.1:42424"
>>> sqlConnectionString="data source=127.0.0.1;user
>>> id=sa;password=" cookieless="true" timeout="1" />
>>>
>>> >-----Original Message-----
>>> >That would be the way to do it.
>>> >
>>> >What makes you think that it is not working?
>>> >
>>> >"Geigho" <ighodaro@zeonchemicals.com> wrote in message
>>> >news:0a7501c34a25$55ed5b50$a501280a@phx.gbl...
>>> >> Setting session timeout in web.config file does not
>>> seem
>>> >> to have any effect. Any explanation or suggestion[/color][/color]
>will[color=green][color=darkred]
>>> be
>>> >> appreciated.
>>> >
>>> >
>>> >.
>>> >[/color]
>>
>>
>>.
>>[/color]
>.
>[/color] | | | | re: How to set session timeout
Thanks.
[color=blue]
>-----Original Message-----
>You set this value in the constructor for the
>FormsAuthenticationTicket as shown below. After your[/color]
user[color=blue]
>is authenticated, try something like the following:
>
>FormsAuthenticationTicket tkt;
>string CookieStr;
>HttpCookie ck;
>
>// Create new Auth Ticket. Last argument authentication
>timeout expressed in seconds.
>
>SessionTimeout = 30; //Timeout in minutes
>
>tkt = new FormsAuthenticationTicket(txtUserName.Text,
>false, SessionTimeout * 60);
>
>// Encrypt ticket
>CookieStr = FormsAuthentication.Encrypt(tkt);
>
>// Create the cookie
>ck = new HttpCookie(FormsAuthentication.FormsCookieName,
>CookieStr);
>
>//Add cookie to HTTP header
>Response.Cookies.Add(ck);
>
>// Redirect to the main page
>Response.Redirect("Default.htm", true);
>
>HTH.
>
>J. Ptak
>[color=green]
>>-----Original Message-----
>>Thanks! But how do you set forms authentication timeout?
>>If I saved authentication flag in a session variable[/color][/color]
and[color=blue][color=green]
>>the session timed out, is the variable still available?
>>If not, then won't this cause the login page to be
>>redisplay since the authentication code (logic) cannot
>>read the value set in the session variable?
>>[color=darkred]
>>>-----Original Message-----
>>>forms authentication and session state are not related.
>>>
>>>youre forms authentication timeout specifies how long[/color]
>>after a period of[color=darkred]
>>>inactivity should the user be taken back to the login[/color]
>>page.[color=darkred]
>>>
>>>Session state just says how long to maintain session[/color]
>>data for. If the[color=darkred]
>>>session timeout is shorter then the authentication[/color]
>>timeout, the session data[color=darkred]
>>>will dissapear, but the user will still be[/color]
>>authenticated, and thus not be[color=darkred]
>>>asked to relog in.
>>>
>>>"geigho" <ighodaro@zeonchemicals.com> wrote in message
>>>news:020901c34a33$38136ad0$a301280a@phx.gbl.. .
>>>> I am using a form based login. It does not matter[/color][/color][/color]
what[color=blue][color=green][color=darkred]
>>>> value I set timeout to (e.g timeout="1",[/color][/color][/color]
timeout="20",[color=blue][color=green][color=darkred]
>>>> timeout="120", etc), the application always takes me[/color]
>>back[color=darkred]
>>>> to the login form after approximately 20 minutes of[/color][/color][/color]
not[color=blue][color=green][color=darkred]
>>>> posting the page back to the server.
>>>>
>>>> <sessionState mode="InProc"
>>>> stateConnectionString="tcpip=127.0.0.1:42424"
>>>> sqlConnectionString="data source=127.0.0.1;user
>>>> id=sa;password=" cookieless="true" timeout="1" />
>>>>
>>>> >-----Original Message-----
>>>> >That would be the way to do it.
>>>> >
>>>> >What makes you think that it is not working?
>>>> >
>>>> >"Geigho" <ighodaro@zeonchemicals.com> wrote in[/color][/color][/color]
message[color=blue][color=green][color=darkred]
>>>> >news:0a7501c34a25$55ed5b50$a501280a@phx.gbl...
>>>> >> Setting session timeout in web.config file does[/color][/color][/color]
not[color=blue][color=green][color=darkred]
>>>> seem
>>>> >> to have any effect. Any explanation or suggestion[/color]
>>will[color=darkred]
>>>> be
>>>> >> appreciated.
>>>> >
>>>> >
>>>> >.
>>>> >
>>>
>>>
>>>.
>>>[/color]
>>.
>>[/color]
>.
>[/color] | | | | re: How to set session timeout
Thanks.
[color=blue]
>-----Original Message-----
>You set this value in the constructor for the
>FormsAuthenticationTicket as shown below. After your[/color]
user[color=blue]
>is authenticated, try something like the following:
>
>FormsAuthenticationTicket tkt;
>string CookieStr;
>HttpCookie ck;
>
>// Create new Auth Ticket. Last argument authentication
>timeout expressed in seconds.
>
>SessionTimeout = 30; //Timeout in minutes
>
>tkt = new FormsAuthenticationTicket(txtUserName.Text,
>false, SessionTimeout * 60);
>
>// Encrypt ticket
>CookieStr = FormsAuthentication.Encrypt(tkt);
>
>// Create the cookie
>ck = new HttpCookie(FormsAuthentication.FormsCookieName,
>CookieStr);
>
>//Add cookie to HTTP header
>Response.Cookies.Add(ck);
>
>// Redirect to the main page
>Response.Redirect("Default.htm", true);
>
>HTH.
>
>J. Ptak
>[color=green]
>>-----Original Message-----
>>Thanks! But how do you set forms authentication timeout?
>>If I saved authentication flag in a session variable[/color][/color]
and[color=blue][color=green]
>>the session timed out, is the variable still available?
>>If not, then won't this cause the login page to be
>>redisplay since the authentication code (logic) cannot
>>read the value set in the session variable?
>>[color=darkred]
>>>-----Original Message-----
>>>forms authentication and session state are not related.
>>>
>>>youre forms authentication timeout specifies how long[/color]
>>after a period of[color=darkred]
>>>inactivity should the user be taken back to the login[/color]
>>page.[color=darkred]
>>>
>>>Session state just says how long to maintain session[/color]
>>data for. If the[color=darkred]
>>>session timeout is shorter then the authentication[/color]
>>timeout, the session data[color=darkred]
>>>will dissapear, but the user will still be[/color]
>>authenticated, and thus not be[color=darkred]
>>>asked to relog in.
>>>
>>>"geigho" <ighodaro@zeonchemicals.com> wrote in message
>>>news:020901c34a33$38136ad0$a301280a@phx.gbl.. .
>>>> I am using a form based login. It does not matter[/color][/color][/color]
what[color=blue][color=green][color=darkred]
>>>> value I set timeout to (e.g timeout="1",[/color][/color][/color]
timeout="20",[color=blue][color=green][color=darkred]
>>>> timeout="120", etc), the application always takes me[/color]
>>back[color=darkred]
>>>> to the login form after approximately 20 minutes of[/color][/color][/color]
not[color=blue][color=green][color=darkred]
>>>> posting the page back to the server.
>>>>
>>>> <sessionState mode="InProc"
>>>> stateConnectionString="tcpip=127.0.0.1:42424"
>>>> sqlConnectionString="data source=127.0.0.1;user
>>>> id=sa;password=" cookieless="true" timeout="1" />
>>>>
>>>> >-----Original Message-----
>>>> >That would be the way to do it.
>>>> >
>>>> >What makes you think that it is not working?
>>>> >
>>>> >"Geigho" <ighodaro@zeonchemicals.com> wrote in[/color][/color][/color]
message[color=blue][color=green][color=darkred]
>>>> >news:0a7501c34a25$55ed5b50$a501280a@phx.gbl...
>>>> >> Setting session timeout in web.config file does[/color][/color][/color]
not[color=blue][color=green][color=darkred]
>>>> seem
>>>> >> to have any effect. Any explanation or suggestion[/color]
>>will[color=darkred]
>>>> be
>>>> >> appreciated.
>>>> >
>>>> >
>>>> >.
>>>> >
>>>
>>>
>>>.
>>>[/color]
>>.
>>[/color]
>.
>[/color] |  | | | | /bytes/about
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 226,272 network members.
|