Louise,

If Session("Name") Is Nothing Then
Response.Redirect("default.aspx")
End If

Sincerely,

--
S. Justin Gengo, MCP
Web Developer

Free code library at:
[url]www.aboutfortunate.com[/url]

"Out of chaos comes order."
Nietzche


"Louise Parker" <lparker@matrell.co.uk> wrote in message
news:0d5b01c360d4$3d870d20$a501280a@phx.gbl...
> Hi everyone,
>
> I would like my ASP.net webpages to redirect to the login
> page when the session times out, instead of displaying an
> error message when I reference a Session variable.
>
> When I try to access the variable, it displays:
> "Object reference not set to an instance of an object"
>
> How can I check if the session has timed out, and redirect
> to another page?
>
> Thanks in advance,
>
> Louise Parker
> Software Developer
> Matrell Designs