Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Logout?

Logout?

Scheduled Pinned Locked Moved ASP.NET
tutorialquestion
13 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Karthick_gc
    wrote on last edited by
    #1

    Hi, I designed a login form in my website. when a user login active field in a table will be set to true. Its working. But i keep my logout control in the master page. So how to set active field to false when the user logout from any page. Can anyone give idea ?

    B K 5 Replies Last reply
    0
    • K Karthick_gc

      Hi, I designed a login form in my website. when a user login active field in a table will be set to true. Its working. But i keep my logout control in the master page. So how to set active field to false when the user logout from any page. Can anyone give idea ?

      B Offline
      B Offline
      BalasubramanianK
      wrote on last edited by
      #2

      Write down your code in the master page itself...

      Balasubramanian K.

      K 1 Reply Last reply
      0
      • K Karthick_gc

        Hi, I designed a login form in my website. when a user login active field in a table will be set to true. Its working. But i keep my logout control in the master page. So how to set active field to false when the user logout from any page. Can anyone give idea ?

        K Offline
        K Offline
        kumar_k508
        wrote on last edited by
        #3

        Hi, you can write the logout functionality in master page itself ie; you can set the active filed to false is master page it self only...

        K 1 Reply Last reply
        0
        • B BalasubramanianK

          Write down your code in the master page itself...

          Balasubramanian K.

          K Offline
          K Offline
          Karthick_gc
          wrote on last edited by
          #4

          But in master page how can access the Session variables of all the forms? For example if Iam in Form5, and there is session variable of the user name,How can i fetch the value of session variable to set the active field false? Can u send the code?

          1 Reply Last reply
          0
          • K kumar_k508

            Hi, you can write the logout functionality in master page itself ie; you can set the active filed to false is master page it self only...

            K Offline
            K Offline
            Karthick_gc
            wrote on last edited by
            #5

            But in master page how can access the Session variables of all the forms? For example if Iam in Form5, and there is session variable of the user name,How can i fetch the value of session variable to set the active field false?

            C 1 Reply Last reply
            0
            • K Karthick_gc

              Hi, I designed a login form in my website. when a user login active field in a table will be set to true. Its working. But i keep my logout control in the master page. So how to set active field to false when the user logout from any page. Can anyone give idea ?

              K Offline
              K Offline
              kumar_k508
              wrote on last edited by
              #6

              Hi, you can use this code for clearing all the cookies and session variables... Response.Cookies.Remove(FormsAuthentication.FormsCookieName) Response.Cookies.Remove("YOUR COOKIE NAME")'for a particular cookie Session.RemoveAll() Session.Abandon()

              K 1 Reply Last reply
              0
              • K kumar_k508

                Hi, you can use this code for clearing all the cookies and session variables... Response.Cookies.Remove(FormsAuthentication.FormsCookieName) Response.Cookies.Remove("YOUR COOKIE NAME")'for a particular cookie Session.RemoveAll() Session.Abandon()

                K Offline
                K Offline
                Karthick_gc
                wrote on last edited by
                #7

                I write this for erase the session variable. Its working. Session.Abandon(); But i want to set the active field in the database table to false. How it is possible?

                1 Reply Last reply
                0
                • K Karthick_gc

                  Hi, I designed a login form in my website. when a user login active field in a table will be set to true. Its working. But i keep my logout control in the master page. So how to set active field to false when the user logout from any page. Can anyone give idea ?

                  K Offline
                  K Offline
                  kumar_k508
                  wrote on last edited by
                  #8

                  Hi Karthick, keep the user info ie; userid etc in session variable,by accessing that userinfo in master page you can upadte your database for the particular user active field to false ...:thumbsup:

                  K 1 Reply Last reply
                  0
                  • K kumar_k508

                    Hi Karthick, keep the user info ie; userid etc in session variable,by accessing that userinfo in master page you can upadte your database for the particular user active field to false ...:thumbsup:

                    K Offline
                    K Offline
                    Karthick_gc
                    wrote on last edited by
                    #9

                    Yes I keep the UserId in the Session variable of the Home page. But i cant access it from the Master page. Shall u tell me how u can access it? Pls..

                    G 1 Reply Last reply
                    0
                    • K Karthick_gc

                      Yes I keep the UserId in the Session variable of the Home page. But i cant access it from the Master page. Shall u tell me how u can access it? Pls..

                      G Offline
                      G Offline
                      Greg Chelstowski
                      wrote on last edited by
                      #10

                      Session variables are not bound to forms. They're Session variables. What's your question? You access the Session variable from anywhere in the project. Before you do

                      Session.Abandon();

                      use the UserId to set the login flag to false.

                      var question = (_2b || !(_2b));

                      1 Reply Last reply
                      0
                      • K Karthick_gc

                        Hi, I designed a login form in my website. when a user login active field in a table will be set to true. Its working. But i keep my logout control in the master page. So how to set active field to false when the user logout from any page. Can anyone give idea ?

                        K Offline
                        K Offline
                        kumar_k508
                        wrote on last edited by
                        #11

                        Hi, assign session("your session variable name") to some object or some string after that by using that string value you can update the database... at last write session.abandon()

                        K 1 Reply Last reply
                        0
                        • K kumar_k508

                          Hi, assign session("your session variable name") to some object or some string after that by using that string value you can update the database... at last write session.abandon()

                          K Offline
                          K Offline
                          Karthick_gc
                          wrote on last edited by
                          #12

                          S. I did it. Thanks...

                          1 Reply Last reply
                          0
                          • K Karthick_gc

                            But in master page how can access the Session variables of all the forms? For example if Iam in Form5, and there is session variable of the user name,How can i fetch the value of session variable to set the active field false?

                            C Offline
                            C Offline
                            Cybernate
                            wrote on last edited by
                            #13

                            You can access the Session normally as you would do in the form 5. As long as the value is added to the session you will be able to access it from anywhere in you code using the session property.

                            Regards, Cybernate

                            1 Reply Last reply
                            0
                            Reply
                            • Reply as topic
                            Log in to reply
                            • Oldest to Newest
                            • Newest to Oldest
                            • Most Votes


                            • Login

                            • Don't have an account? Register

                            • Login or register to search.
                            • First post
                              Last post
                            0
                            • Categories
                            • Recent
                            • Tags
                            • Popular
                            • World
                            • Users
                            • Groups