Re: session object: simple question

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Curt_C [MVP] (software_AT_darkfalz.com)
Date: 08/31/04


Date: Tue, 31 Aug 2004 09:31:03 -0500

Are you using any authentication? If you are then have that redirect to the
login page if it's expired, that's what it's designed for. If you aren't
just run a check
if(Session["blah"] is null)

-- 
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Nikhil Patel" <nikhil0100@aol.com> wrote in message 
news:uObhIV2jEHA.2948@TK2MSFTNGP11.phx.gbl...
> Hi all,
>   I am using a Session object in my ASP.Net application to store a value 
> of
> a Database field. I can access it as ...
>    int iProposalId = Session["ProposalId"];
>
> The session timeout is set to 20. Now my question is if the session 
> expires,
> would the above statement produce any exception? If I can't find the
> ProposalId value in the session object, I would like to display a message 
> to
> the user and close the window.
>
> Thanks.
> -Nikhil
>
> 


Relevant Pages

  • Re: Login page & Session data...response.redirect, server.transfer or ???
    ... > I've been taking this user info and placing it in the Session object ... > Redirect kills the current thread and thus the session data is lost. ... > the beginning and walks through the login process all over again. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Session object timout
    ... > specifying your OS and IIS level, but the phenomenon may be caused by the ... > app is running in. ... >> users must go through a login page. ... >> recreating the session object which holds the class I mentioned above. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Login page & Session data...response.redirect, server.transfer or ???
    ... >> So you need to use Forms Authentication to authenticate a given UID and ... >> Sample code requires you to have a login method on your Principal class ... >> mUser = CType(Thread.CurrentPrincipal, myUser) ... > I've been taking this user info and placing it in the Session object ...
    (microsoft.public.dotnet.framework.aspnet)
  • Login page & Session data...response.redirect, server.transfer or ???
    ... object that stores the user's basic profile data (username, user type, ... I've been taking this user info and placing it in the Session object ... Redirect kills the current thread and thus the session data is lost. ... the beginning and walks through the login process all over again. ...
    (microsoft.public.dotnet.framework.aspnet)
  • RE: Login page & Session data...response.redirect, server.transfer or
    ... > object that stores the user's basic profile data (username, user type, ... > I've been taking this user info and placing it in the Session object ... > Redirect kills the current thread and thus the session data is lost. ... > the beginning and walks through the login process all over again. ...
    (microsoft.public.dotnet.framework.aspnet)