how to redirect to loginpage after session timeout

A

Ather Ali Shaikh

Hello
I am using Forms Authentication. but the page is not redirect to desired
login page after session is expired.
When I debug the application. Session_end is called.
In the Session_End method I write code to redirect to the LoginPage as
(response.redirect("Login.aspx") or server.transfer("Login.aspx")).
But it is not redirecting. It runs the redirecting code but physically not
redirect.

What should I do more.?

Regards
Ather Ali
 
A

Anachostic

Keep in mind that all web sessions are disconnected. With that said,
once a person loads a page from the web server, no code that runs on the
server can affect that person because they are disconnected.

The server will handle killing of the user's session so the next time
they request a page, they will need to authenticate. However, to enforce
this on the client, you can use Meta Refresh or Javascript to redirect
them to onther page after their time is expired.

Personally, I would be be careful about what you impose on the client. A
user might not be happy about having their browser page redirected if
they are in the middle of reading a sentence or just about completed with
a long form.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top