Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - session problem
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

session problem

 Post Reply Post Reply
Author
brolinuk View Drop Down
Newbie
Newbie
Avatar

Joined: 24 October 2003
Location: United Kingdom
Status: Offline
Points: 24
Post Options Post Options   Thanks (0) Thanks(0)   Quote brolinuk Quote  Post ReplyReply Direct Link To This Post Topic: session problem
    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



Edited by brolinuk
Back to Top
MorningZ View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 May 2002
Location: United States
Status: Offline
Points: 1793
Post Options Post Options   Thanks (0) Thanks(0)   Quote MorningZ Quote  Post ReplyReply Direct Link To This Post Posted: 06 November 2003 at 8:27pm

try

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

Contribute to the working anarchy we fondly call the Internet
Back to Top
brolinuk View Drop Down
Newbie
Newbie
Avatar

Joined: 24 October 2003
Location: United Kingdom
Status: Offline
Points: 24
Post Options Post Options   Thanks (0) Thanks(0)   Quote brolinuk Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
zaboss View Drop Down
Senior Member
Senior Member


Joined: 20 August 2002
Location: Romania
Status: Offline
Points: 454
Post Options Post Options   Thanks (0) Thanks(0)   Quote zaboss Quote  Post ReplyReply Direct Link To This Post Posted: 06 November 2003 at 11:33pm
Cristian Banu
Soft 4 web
Back to Top
MorningZ View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 May 2002
Location: United States
Status: Offline
Points: 1793
Post Options Post Options   Thanks (0) Thanks(0)   Quote MorningZ Quote  Post ReplyReply Direct Link To This Post 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 devguru (VBScript link, their javascript section is also excellent) and w3schools (learn ASP)... also make sure to check out the "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
Back to Top
MorningZ View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 May 2002
Location: United States
Status: Offline
Points: 1793
Post Options Post Options   Thanks (0) Thanks(0)   Quote MorningZ Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.