Session Variables

Results 1 to 3 of 3

Thread: Session Variables

  1. #1
    Join Date
    Dec 1969

    Default Session Variables

    Hi Guys,<BR><BR>I am trying to set a session variable with either :<BR><BR>Response.Cookies("HoldUserId")("UserId") = UserId <BR>Or<BR>Session("UserId") = UserId<BR><BR>UserId definately contains a value.<BR><BR>But when I navigate to a new page I can not get the session variables Value. I am using :<BR><BR>Label1.Text = Response.Cookies("HoldUserId")("UserId")<BR>Or<BR> Label1.Text = Session("UserId") <BR><BR>but Label1.text does not contain anything.<BR><BR>What am I doing wrong?<BR><BR>Your help is appreciated.<BR><BR>Best Regards,<BR><BR>Steve Wilson. <BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Session Variables

    It should be:<BR>Label1.Text = Request.Cookies("HoldUserId")("UserId")<BR><BR><BR>If you response.write the session value just after you assign it,does it show anything?ie.:If you do<BR><BR>Session("UserId") = UserId<BR>Response.write "Debug:UserId="&UserId<BR>Response.write "Debug:Session="&Session("UserId") <BR><BR>Do you see the value displayed?<BR><BR>

  3. #3
    Join Date
    Dec 1969

    Default cookie

    as far as the cookie goes, you need to use Request.Cookies to retrieve the value and Reponse.Cookies to write it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts