"Logging in" to a specific session with asp.net session provider

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Kocureq

    "Logging in" to a specific session with asp.net session provider

    Hi all,

    I'm using a default, InProc ASP.NET session provider, ASP.NET 3.5.

    I want to use a nice flash file uploader. The problem with it is that it
    can't send cookies with the files, so I don't know on ASP.NET from which
    client the files are comming.

    I can modify the form action parameter with javascript to say, e.g.
    upload.aspx?ses sionID=X, where X is ASP.NET session ID read from cookie.
    However, I can't find a way to access a specific session on ASP.NET. Is
    it possible?
    --
    /\ /\ [ Jakub 'Kocureq' Anderwald ] /\ /\
    =^;^= [ [nick][at][nick].com ] =^;^=
    / | [ GG# 1365999 ICQ# 31547220 ] | \
    (___(|_|_| [ kocureq@jabber. org ] |_|_|)___)
  • Michael Nemtsev [MVP]

    #2
    Re: "Loggin g in" to a specific session with asp.net session provider

    Hello Kocureq,

    JS runs on client, and your session in serverside stuff.
    There is no standard way to access your session in js if you are not using
    hidden fields or ajax
    >so I don't know on ASP.NET from which client the files are comming.
    what exactly do u need to get?! user name or what?


    ---
    WBR,
    Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour

    "The greatest danger for most of us is not that our aim is too high and we
    miss it, but that it is too low and we reach it" (c) Michelangelo


    KHi all,
    K>
    KI'm using a default, InProc ASP.NET session provider, ASP.NET 3.5.
    K>
    KI want to use a nice flash file uploader. The problem with it is that
    Kit can't send cookies with the files, so I don't know on ASP.NET from
    Kwhich client the files are comming.
    K>
    KI can modify the form action parameter with javascript to say, e.g.
    Kupload.aspx?se ssionID=X, where X is ASP.NET session ID read from
    Kcookie. However, I can't find a way to access a specific session on
    KASP.NET. Is it possible?
    K>


    Comment

    • Kocureq

      #3
      Re: "Loggin g in" to a specific session with asp.net session provider

      Michael Nemtsev [MVP] pisze:
      JS runs on client, and your session in serverside stuff.
      There is no standard way to access your session in js if you are not
      using hidden fields or ajax
      I don't want to access it.

      See, I have a flash upload "widget", that uploads files nicely to my
      ASP.NET website, but doesn't send the session cookies.

      In ASP.NET I need to know which user has sent me the file - so I have to
      access this user's session. One method I thought of is to use Javascript
      to take out the session ID from cookie and send it with the picture,
      e.g. modify the form action from

      upload.aspx

      to

      upload.aspx?ses sion_id=9uu8053 ungwe8ryt83

      so I can get the session ID on ASP.NET side.

      However, I need a way to tell ASP.NET "here's the session ID - use this
      one".

      --
      /\ /\ [ Jakub 'Kocureq' Anderwald ] /\ /\
      =^;^= [ [nick][at][nick].com ] =^;^=
      / | [ GG# 1365999 ICQ# 31547220 ] | \
      (___(|_|_| [ kocureq@jabber. org ] |_|_|)___)

      Comment

      • Kocureq

        #4
        Re: "Loggin g in" to a specific session with asp.net session provider

        Kocureq pisze:
        Michael Nemtsev [MVP] pisze:
        >
        >JS runs on client, and your session in serverside stuff.
        >There is no standard way to access your session in js if you are not
        >using hidden fields or ajax
        >
        I don't want to access it.
        >
        See, I have a flash upload "widget", that uploads files nicely to my
        ASP.NET website, but doesn't send the session cookies.
        >
        In ASP.NET I need to know which user has sent me the file - so I have to
        access this user's session. One method I thought of is to use Javascript
        to take out the session ID from cookie and send it with the picture,
        e.g. modify the form action from
        >
        upload.aspx
        >
        to
        >
        upload.aspx?ses sion_id=9uu8053 ungwe8ryt83
        >
        so I can get the session ID on ASP.NET side.
        >
        However, I need a way to tell ASP.NET "here's the session ID - use this
        one".
        Can anyone please help?

        Or maybe there is a better, ASP.NET-compatible fancy multi-file upload
        with real progress bar?

        --
        /\ /\ [ Jakub 'Kocureq' Anderwald ] /\ /\
        =^;^= [ [nick][at][nick].com ] =^;^=
        / | [ GG# 1365999 ICQ# 31547220 ] | \
        (___(|_|_| [ kocureq@jabber. org ] |_|_|)___)

        Comment

        • Michael Nemtsev [MVP]

          #5
          Re: "Loggin g in" to a specific session with asp.net session provider

          Hello Kocureq,

          I hope this sample will help http://www.codeproject.com/KB/webfor...gress_Bar.aspx

          ---
          WBR,
          Michael Nemtsev [Microsoft MVP] :: blog: http://spaces.live.com/laflour

          "The greatest danger for most of us is not that our aim is too high and we
          miss it, but that it is too low and we reach it" (c) Michelangelo


          KKocureq pisze:
          K>
          >Michael Nemtsev [MVP] pisze:
          >>
          >>JS runs on client, and your session in serverside stuff.
          >>There is no standard way to access your session in js if you are not
          >>using hidden fields or ajax
          >I don't want to access it.
          >>
          >See, I have a flash upload "widget", that uploads files nicely to my
          >ASP.NET website, but doesn't send the session cookies.
          >>
          >In ASP.NET I need to know which user has sent me the file - so I have
          >to access this user's session. One method I thought of is to use
          >Javascript to take out the session ID from cookie and send it with
          >the picture, e.g. modify the form action from
          >>
          >upload.aspx
          >>
          >to
          >>
          >upload.aspx?se ssion_id=9uu805 3ungwe8ryt83
          >>
          >so I can get the session ID on ASP.NET side.
          >>
          >However, I need a way to tell ASP.NET "here's the session ID - use
          >this one".
          >>
          KCan anyone please help?
          K>
          KOr maybe there is a better, ASP.NET-compatible fancy multi-file
          Kupload with real progress bar?
          K>


          Comment

          Working...