Author: Peter Smith | Posted on: 10/29/2010 3:55:04 AM | Views : 277

I want to access the user session from a web method. But when I check for the session object, its nothing! How can I access the current user's session from the webmethod?

My code:

<System.Web.Script.Services.ScriptService()> _
<WebService(Namespace:="http://tempuri.org/")> _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
 Public Class DalService
    Inherits System.Web.Services.WebService

  <WebMethod()> _
    Public Function AddFavourite(ByVal locationId As Integer) As Integer
        Dim result As Integer = 0
        If Session IsNot Nothing Then
            'DO SOMETHING
        E ...

Go to the complete details ...