Session variables

Results 1 to 2 of 2

Thread: Session variables

  1. #1
    Join Date
    Dec 1969

    Default Session variables

    When i use session variable in my page, when I hit Refresh on my browser, my session variable is destroyed. Why??? The session is not over - or is? I want to have login/logout type of page, and I need to store the user username in session variable that would be available to all pages that user go to (once loged in). How do I do that?

  2. #2
    Mark Parter Guest

    Default RE: Session variables

    Do you have a Global.asa file created. Here is an example:<BR><BR>&#060;SCRIPT LANGUAGE="VBScript" RUNAT="SERVER"&#062;<BR>Sub Application_OnStart<BR> Session.Timeout = 15 <BR>End Sub<BR><BR>Sub Session_OnStart<BR> Session("CurrentUser") = ""<BR>End Sub<BR><BR>Sub Session_OnEnd<BR> Set Session("CurrentUser") = Nothing<BR>End Sub<BR>&#060;/SCRIPT&#062;<BR><BR>On the page where you store the variable simply put<BR>Session("CurrentUser") = Request("Username")<BR><BR>Also make sure that you only have 1 Global.asa file in the folder where your site is running.

Posting Permissions

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