Solved

Select only uid from cookie

Posted on 2009-05-11
4
386 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 500 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

948 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now