Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

delete domain from LOGON USER session variable

Status
Not open for further replies.

rixter67

MIS
Sep 18, 2001
28
0
0
US
I am trying to set a session variable when the user logs into the domain. Is there a way to strip the domain name so that I can pass along only the user to the next related page?

Any help is appreciated.
 
If you are using VBScript for your ASP, you might have good luck with using either the InStr() or InStrRev() function to find the position of the slash character that separates the username from the domain.

Once you know the position, you could use the Mid() function to read everything from the next character on.

Or you could even combine the two on one line. Perhaps with something like this:
Code:
MyName = Mid(Request.ServerVariables("LOGON_USER"), _
            (InStr(Request.ServerVariables("LOGON_USER"), "\") + 1))
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top