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. Problem with session....

Problem with session....

Scheduled Pinned Locked Moved ASP.NET
csharphelpasp-netsysadminquestion
9 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.
  • P Offline
    P Offline
    pavya_Cool
    wrote on last edited by
    #1

    Hello all, I have developed a web application in ASP.Net using C# with login credentials. I am getting following problem with it..... I am logging in as user "abc" from one computer in network, its working fine. At the same time, i m logging in as different user say "xyz" on other computer. After this, when i refreshes my "abc" user's page it shows all contents of "xyz" user and hence automatically expires session of "abc". I am not getting where the actual problem is, please anyone of u can help me with this?

    Pravin

    J S P 3 Replies Last reply
    0
    • P pavya_Cool

      Hello all, I have developed a web application in ASP.Net using C# with login credentials. I am getting following problem with it..... I am logging in as user "abc" from one computer in network, its working fine. At the same time, i m logging in as different user say "xyz" on other computer. After this, when i refreshes my "abc" user's page it shows all contents of "xyz" user and hence automatically expires session of "abc". I am not getting where the actual problem is, please anyone of u can help me with this?

      Pravin

      J Offline
      J Offline
      John ph
      wrote on last edited by
      #2

      pavya_Cool wrote:

      when i refreshes my "abc" user's page it shows all contents of "xyz" user and hence automatically expires session of "abc".

      Are you using Application variable to store the user details? And what is the authentication mode here?

      - Regards -
         JON


      Life is not measured by the amount of breaths we take, but by the moments that take our breath away.


      P 1 Reply Last reply
      0
      • P pavya_Cool

        Hello all, I have developed a web application in ASP.Net using C# with login credentials. I am getting following problem with it..... I am logging in as user "abc" from one computer in network, its working fine. At the same time, i m logging in as different user say "xyz" on other computer. After this, when i refreshes my "abc" user's page it shows all contents of "xyz" user and hence automatically expires session of "abc". I am not getting where the actual problem is, please anyone of u can help me with this?

        Pravin

        S Offline
        S Offline
        SHatchard
        wrote on last edited by
        #3

        Can you post an example of the code you are using to store the details of the current user?

        P 1 Reply Last reply
        0
        • J John ph

          pavya_Cool wrote:

          when i refreshes my "abc" user's page it shows all contents of "xyz" user and hence automatically expires session of "abc".

          Are you using Application variable to store the user details? And what is the authentication mode here?

          - Regards -
             JON


          Life is not measured by the amount of breaths we take, but by the moments that take our breath away.


          P Offline
          P Offline
          pavya_Cool
          wrote on last edited by
          #4

          Hi I am using session variable here...and authentication mode is forms.

          Pravin

          1 Reply Last reply
          0
          • S SHatchard

            Can you post an example of the code you are using to store the details of the current user?

            P Offline
            P Offline
            pavya_Cool
            wrote on last edited by
            #5

            private void BtnGo_Click(object sender, System.EventArgs e) { Label1.Visible=false; bool persistcookie=true; if(ValidateUser(TextBox1.Text,TextBox2.Text)) { //string globalstrConn="Provider=SQLOLEDB;Data Source=localhost;Initial Catalog=iMedia;Integrated Security=SSPI;"; Session["UserName"]=TextBox1.Text; //This will store the username of the user in this session variable // We can retrieve this username on different pages by using following code. // string str=Convert.ToString(Session["UserName"]); FormsAuthenticationTicket tkt; string cookiestr; HttpCookie ck; tkt=new FormsAuthenticationTicket(1,TextBox1.Text,System.DateTime.Now,System.DateTime.Now.AddMinutes(Convert.ToInt32(ConfigurationSettings.AppSettings["timeout"])),persistcookie,"Your Custom Date"); cookiestr=FormsAuthentication.Encrypt(tkt); ck=new HttpCookie(FormsAuthentication.FormsCookieName,cookiestr); if(persistcookie) ck.Expires =tkt.Expiration; ck.Path =FormsAuthentication.FormsCookiePath; Response.Cookies.Add(ck); string strredirect; strredirect=Request["ReturnUrl"]; if(strredirect==null) strredirect="login.aspx"; Response.Redirect(ConfigurationSettings.AppSettings["defaultpage"],true); } else { Label1.Text="Invalid Credentials!"; Label1.Visible=true; // Response.Redirect("login.aspx",true); } } Please someone help me.

            Pravin

            1 Reply Last reply
            0
            • P pavya_Cool

              Hello all, I have developed a web application in ASP.Net using C# with login credentials. I am getting following problem with it..... I am logging in as user "abc" from one computer in network, its working fine. At the same time, i m logging in as different user say "xyz" on other computer. After this, when i refreshes my "abc" user's page it shows all contents of "xyz" user and hence automatically expires session of "abc". I am not getting where the actual problem is, please anyone of u can help me with this?

              Pravin

              P Offline
              P Offline
              Pete OHanlon
              wrote on last edited by
              #6

              I'm very suspicious of your post because it's identical to the following posts. http://www.codeproject.com/script/comments/forums.asp?msg=2340463&forumid=12076#xx2340463xx[^] http://www.codeproject.com/script/comments/forums.asp?forumid=12076&select=2340694#xx2340694xx[^] What's going on here?:suss:

              Deja View - the feeling that you've seen this post before.

              My blog | My articles

              P 1 Reply Last reply
              0
              • P Pete OHanlon

                I'm very suspicious of your post because it's identical to the following posts. http://www.codeproject.com/script/comments/forums.asp?msg=2340463&forumid=12076#xx2340463xx[^] http://www.codeproject.com/script/comments/forums.asp?forumid=12076&select=2340694#xx2340694xx[^] What's going on here?:suss:

                Deja View - the feeling that you've seen this post before.

                My blog | My articles

                P Offline
                P Offline
                pavya_Cool
                wrote on last edited by
                #7

                i am not getting responce there.... thats why i posted here ... do u have any problem????

                Pravin

                P 1 Reply Last reply
                0
                • P pavya_Cool

                  i am not getting responce there.... thats why i posted here ... do u have any problem????

                  Pravin

                  P Offline
                  P Offline
                  Pete OHanlon
                  wrote on last edited by
                  #8

                  pavya_Cool wrote:

                  am not getting responce there.... thats why i posted here ... do u have any problem????

                  Yes. These posts aren't under your name. Have you created multiple identities? More importantly, if these are all you, you shouldn't repost in an attempt to get the post to the top. This is a volunteer only forum, and people will get around to your post when they can.

                  Deja View - the feeling that you've seen this post before.

                  My blog | My articles

                  V 1 Reply Last reply
                  0
                  • P Pete OHanlon

                    pavya_Cool wrote:

                    am not getting responce there.... thats why i posted here ... do u have any problem????

                    Yes. These posts aren't under your name. Have you created multiple identities? More importantly, if these are all you, you shouldn't repost in an attempt to get the post to the top. This is a volunteer only forum, and people will get around to your post when they can.

                    Deja View - the feeling that you've seen this post before.

                    My blog | My articles

                    V Offline
                    V Offline
                    Vasudevan Deepak Kumar
                    wrote on last edited by
                    #9

                    Pete O`Hanlon wrote:

                    Have you created multiple identities?

                    In the study of Psychology, there is a concept called 'Multiple Identity Disorder'. A quick Google search shows this: http://skepdic.com/mpd.html[^] Perhaps, is he suffering from that?

                    Vasudevan Deepak Kumar Personal Homepage
                    Tech Gossips
                    A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson

                    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