Solved

Select only uid from cookie

Posted on 2009-05-11
4
395 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

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…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

734 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