Ask a Question related to ASP.NET General, Design and Development.
-
Geigho #1
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.
Geigho Guest
-
how to specify session timeout
Hi I am setting objects in the session using following tycnique. <mx:RemoteObject id="loginidObj" source="servlet" showBusyCursor="true"... -
Session Timeout
Hi, You can control when the session end by using the Session_onEnd event in global.asax. But when the session expired the user won’t make any... -
PHP session timeout
I've modify the php.ini the session.gc_maxlifetime to reduce the time of timeout of the session variabiles. But it not seems to go. In fact the... -
Session.timeout
I have a session object Session("login") whereas I need to extend the time on this to 1 hour, instead of the default 20 minutes. After initializing... -
IIS Session timeout
Is there a way to notify a client browser that their IIS Session is about to OR has just expired? -
Marina #2
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...> Setting session timeout in web.config file does not seem
> to have any effect. Any explanation or suggestion will be
> appreciated.
Marina Guest
-
geigho #3
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" />
seem>-----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 notbe>> to have any effect. Any explanation or suggestion will>>> appreciated.
>
>.
>geigho Guest
-
Marina #4
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...> 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" />
>> seem> >-----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> be> >> to have any effect. Any explanation or suggestion will> >> >> appreciated.
> >
> >.
> >
Marina Guest
-
geigho #5
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?
after a period of>-----Original Message-----
>forms authentication and session state are not related.
>
>youre forms authentication timeout specifies how longpage.>inactivity should the user be taken back to the logindata for. If the>
>Session state just says how long to maintain sessiontimeout, the session data>session timeout is shorter then the authenticationauthenticated, and thus not be>will dissapear, but the user will still beback>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 what
>> value I set timeout to (e.g timeout="1", timeout="20",
>> timeout="120", etc), the application always takes mewill>> 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" />
>>>> seem>> >-----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>> >> to have any effect. Any explanation or suggestion>>> be>> >> appreciated.
>> >
>> >
>> >.
>> >
>
>.
>geigho Guest
-
Jeff Ptak #6
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
>-----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?
>>after a period of>>-----Original Message-----
>>forms authentication and session state are not related.
>>
>>youre forms authentication timeout specifies how long>page.>>inactivity should the user be taken back to the login>data for. If the>>
>>Session state just says how long to maintain session>timeout, the session data>>session timeout is shorter then the authentication>authenticated, and thus not be>>will dissapear, but the user will still be>back>>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 what
>>> value I set timeout to (e.g timeout="1", timeout="20",
>>> timeout="120", etc), the application always takes me>will>>> 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>.>>>>> be
>>> >> appreciated.
>>> >
>>> >
>>> >.
>>> >
>>
>>.
>>
>Jeff Ptak Guest
-
geigho #7
Re: How to set session timeout
Thanks.
user>-----Original Message-----
>You set this value in the constructor for the
>FormsAuthenticationTicket as shown below. After yourand>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
>>>-----Original Message-----
>>Thanks! But how do you set forms authentication timeout?
>>If I saved authentication flag in a session variablewhat>>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?
>>>>after a period of>>>-----Original Message-----
>>>forms authentication and session state are not related.
>>>
>>>youre forms authentication timeout specifies how long>>page.>>>inactivity should the user be taken back to the login>>data for. If the>>>
>>>Session state just says how long to maintain session>>timeout, the session data>>>session timeout is shorter then the authentication>>authenticated, and thus not be>>>will dissapear, but the user will still be>>>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 mattertimeout="20",>>>> value I set timeout to (e.g timeout="1",not>>back>>>> timeout="120", etc), the application always takes me>>>> to the login form after approximately 20 minutes ofmessage>>>> 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 innot>>>> >news:0a7501c34a25$55ed5b50$a501280a@phx.gbl...
>>>> >> Setting session timeout in web.config file does>.>>will>>>> seem
>>>> >> to have any effect. Any explanation or suggestion>>.>>>> be
>>>> >> appreciated.
>>>> >
>>>> >
>>>> >.
>>>> >
>>>
>>>
>>>.
>>>
>>
>geigho Guest



Reply With Quote

