0

I need to ask: I use Forms Authentication in my ASP.NET application.

but when I publish the web after the user login, if he didn't signout he just close the browser and after that he browse it again it will redirect him to default page. How can I enforce redirecting him to the login page even if he didn't sign out?

1
  • @wafa - you should really formulate your question title to be the actual question, and then elaborate in the question body. Remember: it is easier to attract answers here if you put some effort into your question. Commented Sep 28, 2009 at 10:56

3 Answers 3

2

You should see the documentation for forms authentication specified here. You can force the cookies to expire whenever you want setting the timeout attribute. Also, you could not use cookies at all by using the cookieless attribute. There are other optional attributes that could be useful for you, that might not be related to your question as well.

Sign up to request clarification or add additional context in comments.

Comments

0

It will depend on whether or not their asp.net session id cookie still exists, or whether they have cookies enabled at all. To enforce redirecting to the login page you will need to find out how to make the cookies be lost when the browser is closed. In my experience this is the default behaviour anyway.

1 Comment

In fact i noticed that its work correct when I run the application under visual stdio .net but when I publish the web and the user close the browser without logout it redirect him to default page
0

I will suggest you to check asp.net Membership,Profile and Role provider for specifically manage user Logins, Passwords and their profile.

This is one of the good articles from Scott Gu, you should bookmark when you want to work with Membership and Profiles.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.