Solved

Select only uid from cookie

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

760 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

23 Experts available now in Live!

Get 1:1 Help Now