| |

VerySource

 Forgot password?
 Register
Search
View: 763|Reply: 8

Newcomer asks a question about FORMS verification!

[Copy link]

2

Threads

6

Posts

7.00

Credits

Newbie

Rank: 1

Credits
7.00

 China

Post time: 2020-3-3 19:30:01
| Show all posts |Read mode
Excuse me, the initial development login verification system of my website background is verified by FORMS. I want to log in if I want to log out after logging in. How to write code? If it is session, it is better to write, but FORMS verification is written in cookies! Please help out! Thank you
Reply

Use magic Report

0

Threads

119

Posts

67.00

Credits

Newbie

Rank: 1

Credits
67.00

 China

Post time: 2020-5-15 23:45:01
| Show all posts
Cookie.Remove ()
Or set the expiration time to a time in the past
Reply

Use magic Report

0

Threads

29

Posts

23.00

Credits

Newbie

Rank: 1

Credits
23.00

 China

Post time: 2020-5-16 08:00:01
| Show all posts
Clear cookies
Reply

Use magic Report

0

Threads

2

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-5-16 11:30:01
| Show all posts
Go in: Authorize
Cancellation: Cancel authorization
Check it out online
Reply

Use magic Report

2

Threads

6

Posts

7.00

Credits

Newbie

Rank: 1

Credits
7.00

 China

 Author| Post time: 2020-5-16 12:30:01
| Show all posts
What is the specific code, such as session.Abandon () if the session exits! Then Cookie.Remove ()
What? I want to completely delete the cookie generated from FORMS verification to the client!
Reply

Use magic Report

0

Threads

4

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 Germany

Post time: 2020-5-16 13:30:01
| Show all posts
FormsAuthentication.SignOut ()
Reply

Use magic Report

0

Threads

4

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-5-16 22:30:01
| Show all posts
If CookiesSupported is false, the SignOut method will remove the Forms authentication ticket information from the cookie or URL. You can use the SignOut method and the RedirectToLoginPage method in combination to log out a user and allow other users to log in
If running in cookieless mode exclusively, or if mixed mode is supported, the redirection to the login page should be explicitly controlled when special business logic is required after removing the anonymous identifier
Reply

Use magic Report

2

Threads

6

Posts

7.00

Credits

Newbie

Rank: 1

Credits
7.00

 China

 Author| Post time: 2020-5-18 15:30:02
| Show all posts
I found using FormsAuthentication.SignOut ()
After exiting the system, you can also click the Back button to return to the previous page, but it will automatically jump to the landing page when refreshed again. Is there any way to make the page exiting to the landing page not back?
Reply

Use magic Report

0

Threads

29

Posts

19.00

Credits

Newbie

Rank: 1

Credits
19.00

 China

Post time: 2020-5-28 18:30:02
| Show all posts
..... The pages you see back are just cached pages. Clear the cache after clearing cookies? Ha ha

There is an attribute of Page.Identity.Name, after you signout (), this attribute value is empty
You can try
Add to Page_Load ()

if (Page.Identity.Name == string.Empty)
{
.............................. Jumped.
}
Put it inside if (! Page.IsPostBack) or debug it by yourself
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list