# Accessing a SESSION
**Category:** [Epicor ERP 10](https://www.epiusers.help/c/e10/5)
**Created:** 2016-11-21 19:50 UTC
**Views:** 9843
**Replies:** 18
**URL:** https://www.epiusers.help/t/accessing-a-session/36377
---
## Post #1 by @Chris_Conn
What is the proper way to access a SESSION object?
I've read articles saying:
Ice.Core.Session SOSession: The type or namespace name 'Session' does not exist in the namespace 'Ice.Core' (are you missing an assembly reference?)
((Mfg.Core.Session)oTrans.Session).UserName : Error CS0234: The type or namespace name 'Mfg' does not exist in the namespace 'Epicor' (are you missing an assembly reference?)
I am starting to think I maybe be missing an assembly reference lol.
The interesting thing is that I swear I've done this before with no issue in a Customization, but I am having issues within a BPM.
---
## Post #2 by @josecgomez
Within a BPM you shouldn't need the session. You have the Db object context and the callContextClient. What do you need from the session on a BPM?
---
## Post #3 by @Chris_Conn
Which DB I am operating in. I.E Test or Live
---
## Post #4 by @josecgomez
this.Session.AppServerURL should work within a BPM
---
## Post #5 by @Chris_Conn
Really?!?! this.Session with no casting.... lol, boy do I feel silly
---
## Post #6 by @Bart_Elia
I can make it harder if you want but I might get lynched ;)
Let me know if you have issues with it. There are a few advanced gymnastics in there possible when we will need that in the core app. Still waiting to see if people stumble into them in the wild ;)
---
## Post #7 by @Chris_Conn
It seems the AppServerURL var is empty :(
Really wishing my IT would get me access to remote debugging already :cry:
---
## Post #8 by @josecgomez
Works for Me @Chris_Conn
What Method are you running this on? Mine works fine
---
## Post #9 by @Chris_Conn
Running this on a data directive for SYS_TASK table - alerts me by email when MRP starts/stops
String serv = this.Session.AppServerURL ;
message.Body = "
---
## Post #16 by @Chris_Conn
I appreciate the offer but I got it going with a little assistance.
Would the solution you suggest for DNS hostname work for DBs on the same server? I assume the DNS name would be the same.
---
## Post #17 by @darista
[quote="Chris_Conn, post:9, topic:36377"]
this.Session.AppServerURL
[/quote]
Hi @Chris_Conn were you able to fix this? I'm also using the SysTask table to send emails when a process gets an error but when using the Session.APPServerURL the emails are not sent, if I remove it the emails are received.
---
## Post #18 by @Chris_Conn
Ah - I remember now, Session.AppServerURL didnt get populated in that context. I dont remember the exact solution but it involved some squirrely code.
---
## Post #19 by @darista
Thank you I could resolve it, by doing some additional code.
---
**Canonical:** https://www.epiusers.help/t/accessing-a-session/36377
**Original content:** https://www.epiusers.help/t/accessing-a-session/36377