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. How can current Session can be sent with the WebRequest!

How can current Session can be sent with the WebRequest!

Scheduled Pinned Locked Moved ASP.NET
helphtmldatabasesysadminquestion
6 Posts 2 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.
  • R Offline
    R Offline
    Rana Muhammad Javed Khan
    wrote on last edited by
    #1

    I had posted this question couple of days ago but still not able to get the answer. I want to Get HTML by Executing URL on Server. I have got the HTML but problem is this Current Session Values are not being sent. I can't use query string I have to use current sessoin values!!! Any Help will be highly appricated!!!

    F 1 Reply Last reply
    0
    • R Rana Muhammad Javed Khan

      I had posted this question couple of days ago but still not able to get the answer. I want to Get HTML by Executing URL on Server. I have got the HTML but problem is this Current Session Values are not being sent. I can't use query string I have to use current sessoin values!!! Any Help will be highly appricated!!!

      F Offline
      F Offline
      Fred_Smith
      wrote on last edited by
      #2

      Perhaps it would help if you were a little more specific about what you're doing... Are you normally able to read session values on different pages of the same application? If so, what is different about what you're doing in this case? Fred

      R 1 Reply Last reply
      0
      • F Fred_Smith

        Perhaps it would help if you were a little more specific about what you're doing... Are you normally able to read session values on different pages of the same application? If so, what is different about what you're doing in this case? Fred

        R Offline
        R Offline
        Rana Muhammad Javed Khan
        wrote on last edited by
        #3

        Thanks for ur reply! Actually my code is! Dim objWebClient As New WebClient Dim aRequestedHTML() As Byte aRequestedHTML = objWebClient.DownloadData(strURL) Dim objUTF8 As New UTF8Encoding Dim strRequestedHTML As String strRequestedHTML = objUTF8.GetString(aRequestedHTML) GETHTMLStream1 = strRequestedHTML The request(URL) is sent to the server which returns the HTML. Now Problem is this request doesn't able to retrieve session values. Session values are being reterieved on other pages.

        F 1 Reply Last reply
        0
        • R Rana Muhammad Javed Khan

          Thanks for ur reply! Actually my code is! Dim objWebClient As New WebClient Dim aRequestedHTML() As Byte aRequestedHTML = objWebClient.DownloadData(strURL) Dim objUTF8 As New UTF8Encoding Dim strRequestedHTML As String strRequestedHTML = objUTF8.GetString(aRequestedHTML) GETHTMLStream1 = strRequestedHTML The request(URL) is sent to the server which returns the HTML. Now Problem is this request doesn't able to retrieve session values. Session values are being reterieved on other pages.

          F Offline
          F Offline
          Fred_Smith
          wrote on last edited by
          #4

          Well no, it won't... Session values (SessionID anyway) are passed back and forth between the browser and the server whenever a page is requested - a form of cookie; this is how it knows which session values belong to which client - and just passing the URL to the server won't send the session values too. You'll need to re-think your model.... Fred

          R 1 Reply Last reply
          0
          • F Fred_Smith

            Well no, it won't... Session values (SessionID anyway) are passed back and forth between the browser and the server whenever a page is requested - a form of cookie; this is how it knows which session values belong to which client - and just passing the URL to the server won't send the session values too. You'll need to re-think your model.... Fred

            R Offline
            R Offline
            Rana Muhammad Javed Khan
            wrote on last edited by
            #5

            Do you have any suggestion regarding this!!!:confused:

            F 1 Reply Last reply
            0
            • R Rana Muhammad Javed Khan

              Do you have any suggestion regarding this!!!:confused:

              F Offline
              F Offline
              Fred_Smith
              wrote on last edited by
              #6

              Not really, I'm afraid.. if you really need to do it this way, I guess you'll have to pass the session variables as paramters of the url - if you're worried about security, you'll need to encrypt them first. Either that, or go back to the drawing board and see if there isn't another way to achieve whatever it is you're trying to do... Good luck - sorry I cna't be more help... Fred

              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