Print Page | Close Window

session problem

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=7063
Printed Date: 29 March 2026 at 3:46pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: session problem
Posted By: brolinuk
Subject: session problem
Date Posted: 06 November 2003 at 7:41pm

I want to identify whether user has logged in, in order to give them different authority. I know how to use queryString, but I don't like it, as some parameter will display on the URL bar.... I tried to use sessions. I defined Session("Username") in the login.asp file and use the following code to check whether it has got parameter. If it is true it means user has logged in already.  

If IsNull(Session("Username")) = False then

However, the result is always to be true, even the username actually dosen't have a value. Anyboy please give me some help to solve this problem. thanks




Replies:
Posted By: MorningZ
Date Posted: 06 November 2003 at 8:27pm

try

If Trim(Session("Username")) <> "" then



-------------
Contribute to the working anarchy we fondly call the Internet


Posted By: brolinuk
Date Posted: 06 November 2003 at 9:16pm

Thanks MorningZ! It is works!

Where would I be able to find out the detailed reference of asp, such as "Trim" you used



Posted By: zaboss
Date Posted: 06 November 2003 at 11:33pm
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/vtorifunctions.asp - Here.

-------------
Cristian Banu
http://www.soft4web.ro - Soft 4 web


Posted By: MorningZ
Date Posted: 07 November 2003 at 5:05am

i typically avoid MSDN's site like the plague... but its a good resource

better ones IMHO would be http://www.devguru.com - devguru (VBScript link, their javascript section is also excellent) and http://www.w3schools.com - w3schools  (learn ASP)... also make sure to check out the http://forums.webwiz.net/forum_posts.asp?TID=55&PN=1 - "Favortie ASP Help Pages"  thread that i stickied at the top of this very ASP forum



-------------
Contribute to the working anarchy we fondly call the Internet


Posted By: MorningZ
Date Posted: 07 November 2003 at 5:08am

oh yeah also... and this is just advice from me, i don't expect others to agree....

but i HATE dealing with "empty" or "NULL" so i have a function that treats them the same and i include it in a "common" page that gets included on all pages

Function CstrNull( i_val )
      CstrNull = Trim(Cstr("" & i_val))
End Function

that'll return "" for anything null or empty, so most my "checks" are

If CstrNull( whatever_i_am_checking ) <> "" then
    ...etc  etc...



-------------
Contribute to the working anarchy we fondly call the Internet



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net