This might be a silly question with an easy answer, but I cannot seem to find any info on it.
I am creating a webapp for a clients intrant, and I am using session variables, which start as they log in.
EG:
Session["ConsultantFirstname"] = adAuth.getFirstName();
Session["ConsultantLastName"] = adAuth.getLastName();
//Then I also have a reader on page load which creates these...
while (reader.Read())
{
Session["Department"] = reader[1].ToString();
Session["Channelid"] = reader[2].ToString();
Session["EmailAddress"] = reader[3].ToString();
Session["PrimaryTerritory"] = reader[4].ToString();
}
My question is this... How do I see in the browser what session variables have been created? (If I select "Inspect element" > "Resources" > Session storage.. Shouldn't they be there?) I'm quite sure I read a tutorial on this a while ago, but I cannot seem to find it now.
Do I need to add some additional code?
You cannot view the session state variable at client side. Session state is stored at server, and Client browser only knows SessionID which is stored in cookie or URL.
MSDN says:
Sessions are identified by a unique identifier that can be read by using the SessionID property. When session state is enabled for an ASP.NET application, each request for a page in the application is examined for a SessionID value sent from the browser. If no SessionID value is supplied, ASP.NET starts a new session and the SessionID value for that session is sent to the browser with the response.
By default, SessionID values are stored in a cookie. However, you can also configure the application to store SessionID values in the URL for a "cookieless" session.
Google Chrome provides some extension through which you can edit the cookies.
try to put print_r($_SESSION)
; in your code
this will print content of $_SESSION variable at that moment.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With