Session Variables

Results 1 to 3 of 3

Thread: Session Variables

  1. #1
    Join Date
    Dec 1969

    Default Session Variables

    I have lots of intranet sites on the server. But to access those sites the user have to login at least once. And in every page I check for the session as below:<BR><BR>&#060;%<BR>&#039; If the session has expired then force the user to re-login<BR>Call checkSession<BR><BR>Function checkSession()<BR> If NOT Session("loggedIn") = "1" Then<BR> Response.Redirect("login.asp")<BR> End If<BR>End Function<BR><BR>%&#062;<BR><BR>And on the login screen I abandon the session as :<BR><BR>&#060;%<BR> Session.Abandon()<BR>%&#062;<BR><BR>And also I have a logout button where I abandon the session and show the login screen again. But on some systems if the user tries to go to a certain page directly then the program forces him to login. But on some systems it lets the user go in to a page directly without logging in. what could be the problem. <BR><BR>After the login screen if he/she is a valid user I take to a page called main.asp. There I&#039;m again checking for the session variable "logged in".<BR><BR>thanks.

  2. #2
    Join Date
    Dec 1969

    Default RE: Session Variables

    When you set the signin variable is it being set to<BR>Session("loggedin") = 1<BR><BR>or<BR><BR>Session("loggedin") = "1"

  3. #3
    Join Date
    Dec 1969

    Default Don't use Session.Abandon!

    That abandons the session *AFTER* processing the current ASP page!<BR><BR>So if you do:<BR><BR>&#060;%<BR>...<BR>Session.Abandon<BR>.. .<BR>Session("whatever") = "something"<BR>...<BR>%&#062;<BR><BR>You just threw away your Session("whatever") variable!<BR><BR>

Posting Permissions

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