You must Sign In to post a response.
  • Category: .NET

    How Clear Complete memory variables.

    Hi
    Experts

    In my login page I have given username and pwd in my login.aspx page then I saw this

    Do you want Google Chrome to save your password for this site?

    I click save password

    then when i signout

    I use the command
    session.abandon() and clear cookie.

    but after my login page run
    But My username and pwd textbox in my login.aspx page still show the login textbox and pwd also but i need now clear

    How will do this?
  • #762897
    Hi

    Session.Clear();
    Session.RemoveAll();
    Session.Abandon();
    Will remove your session variable, but how you cleared the cookies?


    Try with the below code.


    FormsAuthentication.SignOut();
    Session.Abandon();
    HttpCookie Mycookie = new HttpCookie(FormsAuthentication.FormsCookieName, "");
    cookie1.Expires = DateTime.Now.AddYears(-1);
    Response.Cookies.Add(Mycookie);

    Sridhar Thota.
    Editor: DNS Forum.

  • #762911
    Hi
    Sridhar

    I already used same code but not working

    when i logout i use this code after i redirect login page but there username and pwd textbox shows previous username and pwd how to clear this?

    Can you did and post please.

    Name : Dotnet Developer-2015
    Email Id :kumaraspcode2009@gmail.com

    'Not by might nor by power, but by my Spirit,' says the LORD Almighty.


Sign In to post your comments