Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Select only uid from cookie

Posted on 2009-05-11
4
Medium Priority
?
404 Views
Last Modified: 2012-08-13
How can I retrieve only the uid from this cookie passed after login . That cookies name is USER
departmentname=Parts+Maintenance+%2D+West&telephoneNumber=888%2D555%2D4895&mail=dave%2Esmith%40mysite%2Ecom&sn=smith&postalAddress=3131+Dent+Rd%24Bldg+A+Rm+A126%24Charlotte%2C+NC+28211%2D1516&givenName=David&manager=uid%3D89716%2C+ou%3Dpeople%2C+o%3Dmysite%2C+c%3DUS&islogged=1&managementlevel=&cn=Dave+Smith&uid=453399

Open in new window

0
Comment
Question by:Upperdecker
  • 2
4 Comments
 
LVL 3

Expert Comment

by:SalmanZG
ID: 24355710
Hope this helps:

Lets say you fetch the value of cookie in variable x

x = "departmentname=Parts+Maintenance+%2D+West&telephoneNumber=888%2D555%2D4895&mail=dave%2Esmith%40mysite%2Ecom&sn=smith&postalAddress=3131+Dent+Rd%24Bldg+A+Rm+A126%24Charlotte%2C+NC+28211%2D1516&givenName=David&manager=uid%3D89716%2C+ou%3Dpeople%2C+o%3Dmysite%2C+c%3DUS&islogged=1&managementlevel=&cn=Dave+Smith&uid=453399"

Set re = New RegExp
re.IgnoreCase = True
re.Global = True
re.Pattern = "^.*&uid="

MsgBox re.Replace(x, "")

' The last line will return the value of UID.
0
 
LVL 4

Accepted Solution

by:
CoveyCraig earned 2000 total points
ID: 24361181
Here's a simpler method:

strUID=Request.Cookies("uid")
0
 

Author Closing Comment

by:Upperdecker
ID: 31580185
Thank you
0
 
LVL 4

Expert Comment

by:CoveyCraig
ID: 24620977
You're welcome.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Screencast - Getting to Know the Pipeline
Suggested Courses
Course of the Month10 days, 14 hours left to enroll

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question