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. WebService Sessions

WebService Sessions

Scheduled Pinned Locked Moved ASP.NET
questioncsharpasp-netdatabasealgorithms
3 Posts 3 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.
  • M Offline
    M Offline
    Matt Cavanagh
    wrote on last edited by
    #1

    In my ASP.NET project I have some aspx pages and a webservice(asmx) which get called with ASP.NET AJAX. Now the aspx pages just check for session to get the logged in persons username(for relevant SQL calls) but I had trouble doing the same with my asmx file. I tried a couple different methods after searching but most results are for getting sessions in an ashx file, and the same principals dont work. So what I did was create a public string in my webservice that, on logging in, the aspx page changed to the users name. But then when I checked username it was always just the last person that had logged in, for obvious reasons. So how do I check for sessions in an asmx page? Thanks alot :)

    Strive to be humble enough to take advice, and confident enough to do something about it.

    E A 2 Replies Last reply
    0
    • M Matt Cavanagh

      In my ASP.NET project I have some aspx pages and a webservice(asmx) which get called with ASP.NET AJAX. Now the aspx pages just check for session to get the logged in persons username(for relevant SQL calls) but I had trouble doing the same with my asmx file. I tried a couple different methods after searching but most results are for getting sessions in an ashx file, and the same principals dont work. So what I did was create a public string in my webservice that, on logging in, the aspx page changed to the users name. But then when I checked username it was always just the last person that had logged in, for obvious reasons. So how do I check for sessions in an asmx page? Thanks alot :)

      Strive to be humble enough to take advice, and confident enough to do something about it.

      E Offline
      E Offline
      Eduard Keilholz
      wrote on last edited by
      #2

      You need to enable sessions in your webservice..

      [WebMethod(EnableSession = true)]
      public bool HelloWorld()
      {
      return true;
      }

      .: I love it when a plan comes together :. http://www.zonderpunt.nl

      1 Reply Last reply
      0
      • M Matt Cavanagh

        In my ASP.NET project I have some aspx pages and a webservice(asmx) which get called with ASP.NET AJAX. Now the aspx pages just check for session to get the logged in persons username(for relevant SQL calls) but I had trouble doing the same with my asmx file. I tried a couple different methods after searching but most results are for getting sessions in an ashx file, and the same principals dont work. So what I did was create a public string in my webservice that, on logging in, the aspx page changed to the users name. But then when I checked username it was always just the last person that had logged in, for obvious reasons. So how do I check for sessions in an asmx page? Thanks alot :)

        Strive to be humble enough to take advice, and confident enough to do something about it.

        A Offline
        A Offline
        Abhijit Jana
        wrote on last edited by
        #3

        Have a look into this : Maintaining Session from the Client Application to the Web Service[^]

        Abhijit Jana | Codeproject MVP Web Site : abhijitjana.net Don't forget to click "Good Answer" on the post(s) that helped you.

        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