Sessoins (still having trouble)

Results 1 to 3 of 3

Thread: Sessoins (still having trouble)

  1. #1
    Join Date
    Dec 1969

    Default Sessoins (still having trouble)

    I have a script that collects the info from a form on one page. From that page I need to go to other form pages and keep that user name. I&#039;m trying to use sessions, but I guess I&#039;m an idiot. Here&#039;s what I&#039;ve got:<BR><BR>Session("UserName") = request.form("name")<BR>Response.Write("Session(&# 039;Username&#039;) = " & Session("Username") & "&#060;br /&#062;")<BR>That&#039;s on the first page and the username is written on the browser no problem. On the next page, I have another form and I tried this:<BR>response.write(Session("UserName"))<BR><B R>if isEmpty(Session("UserName")) then<BR> response.redirect("index.asp")<BR> response.end<BR>end if <BR>and nothing happened. Any ideas?<BR>

  2. #2
    Join Date
    Dec 1969

    Default Well.. I can help w/ 1..

    .. but not the other.<BR><BR>I&#039;m not sure why you didn&#039;t get anything for:<BR>response.write(Session("UserName"))<BR><BR >But, I think I know why this didn&#039;t work:<BR>if isEmpty(Session("UserName")) then<BR><BR>I think it isn&#039;t actually Empty. I think it&#039;s a zero-length string. Try this:<BR>If Len(Session("Username")) = 0 Then<BR><BR>-Doug

  3. #3
    Join Date
    Dec 1969

    Default One thing to look for...

    If sessions work on one page and don&#039;t propogate, then check to make sure that you&#039;re accepting cookies. I believe that&#039;s exactly what happens if you&#039;re not accepting cookies.

Posting Permissions

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