Session Variables problem

Results 1 to 3 of 3

Thread: Session Variables problem

  1. #1
    Join Date
    Dec 1969

    Default Session Variables problem

    Hi,<BR>I&#039;m a complete newbie when it comes to ASP, so turn away now if u wish! I need/want to use a session variable to store a users login name when they sign into a web based reporting utility I have. I&#039;m storing their login name like so session("MyName") = document.details.username.value <BR><BR>When I go to use the session variable in my welcome screen, response.write(session("MyName")), it gives me a type mismatch:session error.<BR><BR>Any idea would be greatly appreciated!!<BR><BR>ken

  2. #2
    Steve Cimino Guest

    Default RE: Session Variables problem

    Are you trying to set the session variable on the client? No can do... do this instead:<BR><BR>session("myname") = Request.Form("username")<BR><BR>Make sure you have session state enabled in IIS also.

  3. #3
    Join Date
    Dec 1969

    Default RE: Session Variables problem

    what you are doing is mixing up javascript and asp(vbscript).<BR>try to remember that all asp coding happens before the page reaches the client, and your javascript will only work after the page has loaded (therefore after the asp scripts have run)<BR>you will need to pass the variable to another (or the same) asp page and use request.querystring("") or request.form("")

Posting Permissions

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