HighTechTalks DotNet Forums  

Session Times Out but still logged in with login control?

Dotnet Framework microsoft.public.dotnet.framework


Discuss Session Times Out but still logged in with login control? in the Dotnet Framework forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Bishop
 
Posts: n/a

Default Session Times Out but still logged in with login control? - 11-28-2007 , 10:19 AM






I have a couple items I keep in session variables (using server memory) that
I can't pass across the address line. I've done everything I can find to
extend the sessions as long as possible but eventually the session will time
out. I didn't want to use SQL to hold my session information as this is a
single server enviroment with plenty of memory and I don't want to slow my
application down by waiting on SQL or have an additional dependency.

A new application I built uses the ASP.NET 2005 Login Controls. What I
noticed is that when I loose my session, I'm still logged in. I don't know
much about the login controls but assumed they were session based and would
vanish with my session.

So my question is, can anyone explain why I'm not loosing my login and how
it is being managed that it stays after my session is gone. Maybe I should
use another method such as SQL to manage my session information?

Thanks for any advice!



Reply With Quote
  #2  
Old   
Scott Roberts
 
Posts: n/a

Default Re: Session Times Out but still logged in with login control? - 11-28-2007 , 11:16 AM







"Bishop" <nospam (AT) nospam (DOT) com> wrote

Quote:
A new application I built uses the ASP.NET 2005 Login Controls. What I
noticed is that when I loose my session, I'm still logged in. I don't
know much about the login controls but assumed they were session based and
would vanish with my session.

So my question is, can anyone explain why I'm not loosing my login and how
it is being managed that it stays after my session is gone. Maybe I
should use another method such as SQL to manage my session information?

asp.net membership is cookie-based, not session-based.

Sessions can be lost for a variety of reasons. You obviously want to
minimize their use and try not to depend on things being there for long
periods of time. If you absolutely need to store user info on the server for
long periods of time, I think a DB is going to be the best way to go.



Reply With Quote
  #3  
Old   
Bishop
 
Posts: n/a

Default Re: Session Times Out but still logged in with login control? - 11-28-2007 , 11:41 AM



Ah, thank you.

I tested cookies a while back but never implimented them because I was
loosing the cookie at the same time the session would expire. I know that
dosn't make much sense, maybe it is some configuration with my browser. If
didn't persue it because of that and I was afraid that many people would
have they're cookies disabled.

Have you seen simular results with cookies and any idea what percentage of
browsers have cookies disabled any more? In this particular site, I could
indicate to users that they need to have cookies enabled to use.

Hmmmm... Now that I think about it, the login controls have the "Remember
Me Next Time" option that never seems to work for me but others have
indicated that it works fine for them. Do I just have something set to
expire cookies really fast? I'll investigate on my end but would happly
take any further advice.

Thanks!

"Scott Roberts" <sroberts (AT) no (DOT) spam.here-webworks-software.com> wrote in
message news:Ob3$CodMIHA.3940 (AT) TK2MSFTNGP05 (DOT) phx.gbl...
Quote:
"Bishop" <nospam (AT) nospam (DOT) com> wrote in message
news:e6erFIdMIHA.2140 (AT) TK2MSFTNGP03 (DOT) phx.gbl...
A new application I built uses the ASP.NET 2005 Login Controls. What I
noticed is that when I loose my session, I'm still logged in. I don't
know much about the login controls but assumed they were session based
and would vanish with my session.

So my question is, can anyone explain why I'm not loosing my login and
how it is being managed that it stays after my session is gone. Maybe I
should use another method such as SQL to manage my session information?


asp.net membership is cookie-based, not session-based.

Sessions can be lost for a variety of reasons. You obviously want to
minimize their use and try not to depend on things being there for long
periods of time. If you absolutely need to store user info on the server
for long periods of time, I think a DB is going to be the best way to go.



Reply With Quote
  #4  
Old   
Scott Roberts
 
Posts: n/a

Default Re: Session Times Out but still logged in with login control? - 11-28-2007 , 03:01 PM



To be honest with you, I've never really looked into "cookie-less"
authentication. I think the asp.net membership might auto-detect if cookies
are disabled and automatically switch to url-rewriting. I'm not certain on
that, though.

I believe (and you might want to double-check me on this) that most browsers
support two types of cookies these days. A "session" cookie (not sure if
that's the correct term) is generally permitted under default security
settings. These cookies "expire" when the browser is closed (if not sooner)
and are generally considered harmless. The "persistent" cookies (those that
persist even after the browser is closed) are the potentially dangerous ones
and those are the ones browsers tend to block.

So the "authentication" cookie is a "session" cookie ("session" on the
client, not the server) while the "Remember Me" cookie is "persistent". The
default expiration on the authentication cookie is 20 minutes, which just
happens to coincide with the the default timeout on server sessions. This is
coincidence, they are not related. You can increase the timeout on the
authentication cookie to whatever you want, or set it to "never expire" in
which case it will go away when the browser is closed.



"Bishop" <nospam (AT) nospam (DOT) com> wrote

Quote:
Ah, thank you.

I tested cookies a while back but never implimented them because I was
loosing the cookie at the same time the session would expire. I know that
dosn't make much sense, maybe it is some configuration with my browser.
If didn't persue it because of that and I was afraid that many people
would have they're cookies disabled.

Have you seen simular results with cookies and any idea what percentage of
browsers have cookies disabled any more? In this particular site, I could
indicate to users that they need to have cookies enabled to use.

Hmmmm... Now that I think about it, the login controls have the "Remember
Me Next Time" option that never seems to work for me but others have
indicated that it works fine for them. Do I just have something set to
expire cookies really fast? I'll investigate on my end but would happly
take any further advice.

Thanks!

"Scott Roberts" <sroberts (AT) no (DOT) spam.here-webworks-software.com> wrote in
message news:Ob3$CodMIHA.3940 (AT) TK2MSFTNGP05 (DOT) phx.gbl...

"Bishop" <nospam (AT) nospam (DOT) com> wrote in message
news:e6erFIdMIHA.2140 (AT) TK2MSFTNGP03 (DOT) phx.gbl...
A new application I built uses the ASP.NET 2005 Login Controls. What I
noticed is that when I loose my session, I'm still logged in. I don't
know much about the login controls but assumed they were session based
and would vanish with my session.

So my question is, can anyone explain why I'm not loosing my login and
how it is being managed that it stays after my session is gone. Maybe I
should use another method such as SQL to manage my session information?


asp.net membership is cookie-based, not session-based.

Sessions can be lost for a variety of reasons. You obviously want to
minimize their use and try not to depend on things being there for long
periods of time. If you absolutely need to store user info on the server
for long periods of time, I think a DB is going to be the best way to go.




Reply With Quote
  #5  
Old   
Bishop
 
Posts: n/a

Default Re: Session Times Out but still logged in with login control? - 11-28-2007 , 03:36 PM



That's some really good information, I will read further about all this.
Thank you very much!

"Scott Roberts" <sroberts (AT) no (DOT) spam.here-webworks-software.com> wrote in
message news:e96%234lfMIHA.3516 (AT) TK2MSFTNGP02 (DOT) phx.gbl...
Quote:
To be honest with you, I've never really looked into "cookie-less"
authentication. I think the asp.net membership might auto-detect if
cookies are disabled and automatically switch to url-rewriting. I'm not
certain on that, though.

I believe (and you might want to double-check me on this) that most
browsers support two types of cookies these days. A "session" cookie (not
sure if that's the correct term) is generally permitted under default
security settings. These cookies "expire" when the browser is closed (if
not sooner) and are generally considered harmless. The "persistent"
cookies (those that persist even after the browser is closed) are the
potentially dangerous ones and those are the ones browsers tend to block.

So the "authentication" cookie is a "session" cookie ("session" on the
client, not the server) while the "Remember Me" cookie is "persistent".
The default expiration on the authentication cookie is 20 minutes, which
just happens to coincide with the the default timeout on server sessions.
This is coincidence, they are not related. You can increase the timeout on
the authentication cookie to whatever you want, or set it to "never
expire" in which case it will go away when the browser is closed.



"Bishop" <nospam (AT) nospam (DOT) com> wrote in message
news:OeaeP2dMIHA.3852 (AT) TK2MSFTNGP06 (DOT) phx.gbl...
Ah, thank you.

I tested cookies a while back but never implimented them because I was
loosing the cookie at the same time the session would expire. I know
that dosn't make much sense, maybe it is some configuration with my
browser. If didn't persue it because of that and I was afraid that many
people would have they're cookies disabled.

Have you seen simular results with cookies and any idea what percentage
of browsers have cookies disabled any more? In this particular site, I
could indicate to users that they need to have cookies enabled to use.

Hmmmm... Now that I think about it, the login controls have the
"Remember Me Next Time" option that never seems to work for me but others
have indicated that it works fine for them. Do I just have something set
to expire cookies really fast? I'll investigate on my end but would
happly take any further advice.

Thanks!

"Scott Roberts" <sroberts (AT) no (DOT) spam.here-webworks-software.com> wrote in
message news:Ob3$CodMIHA.3940 (AT) TK2MSFTNGP05 (DOT) phx.gbl...

"Bishop" <nospam (AT) nospam (DOT) com> wrote in message
news:e6erFIdMIHA.2140 (AT) TK2MSFTNGP03 (DOT) phx.gbl...
A new application I built uses the ASP.NET 2005 Login Controls. What I
noticed is that when I loose my session, I'm still logged in. I don't
know much about the login controls but assumed they were session based
and would vanish with my session.

So my question is, can anyone explain why I'm not loosing my login and
how it is being managed that it stays after my session is gone. Maybe
I should use another method such as SQL to manage my session
information?


asp.net membership is cookie-based, not session-based.

Sessions can be lost for a variety of reasons. You obviously want to
minimize their use and try not to depend on things being there for long
periods of time. If you absolutely need to store user info on the server
for long periods of time, I think a DB is going to be the best way to
go.






Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.