Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Select only uid from cookie

Posted on 2009-05-11
4
Medium Priority
?
400 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 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…

705 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