473,749 Members | 2,492 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Where does my local cookie hide and what's it called ?

Hello,

I'm running my script locally and the cookie has been saved on the
machine because the login page is by-passed (with the Redirect to
"menu.asp" below.

OK - but where is my cookie stored? Or at least give me clue. What
will the cookie be called and what text will it contain if:
iAuthorID = 1
iSecurityLvl = 3
uName = "barny" ?

The machine user is "flintstone " and machine name is "W2KPro". The
CookieName will be "mABmyASPBl og"

== == == == ==

Const SITE_NAME = "my ASP Blog"

If getCookie("mAB" & replaceText(SIT E_NAME, "\W+", "")) Then
Response.Redire ct"menu.asp"
End If

Sub saveCookie(uNam e, CookieName)
Response.Cookie s(CookieName)(" aid") = Session("iAutho rID")
Response.Cookie s(CookieName)(" slvl") = Session("iSecur ityLvl")
Response.Cookie s(CookieName)(" login") = uName
Response.Cookie s(CookieName).E xpires = DateAdd("m",3,N ow)
End Sub

Function getCookie(Cooki eName)
Dim iAuthorID, iSecurityLvl, userName, sSQL, rsAuthor
iAuthorID = Request.Cookies (CookieName)("a id")
iSecurityLvl = Request.Cookies (CookieName)("s lvl")
userName = Request.Cookies (CookieName)("l ogin")

If IsWholeNumber(i AuthorID) And IsWholeNumber(i SecurityLvl)
And userName > "" Then
sSQL = "SELECT author_ID FROM tblAuthors" &_
" WHERE userName =" & fixSQLQuotes(us erName) &_
" AND author_ID =" & iAuthorID &_
" AND security_ID =" & iSecurityLvl
Set rsAuthor = doAdoRs("Blog", sSql, 0, 1)
If Not (rsAuthor Is Nothing) Then
If Not(rsAuthor.EO F Or rsAuthor.BOF) Then
Session("iAutho rID") = iAuthorID
Session("iSecur ityLvl") = iSecurityLvl
saveCookie userName, CookieName
getCookie = True
Exit Function
End If
End If
End If
getCookie = False
End Function

Jul 19 '05 #1
2 3656
You should find it in your profile, under cookies. Usually, they are named
us******@domain name.txt

The above is assuming IE, I'm sure other browsers store them differently.
"mark4asp" <ma************ ****@ntlworld.c om> wrote in message
news:6c******** *************** *********@4ax.c om...
Hello,

I'm running my script locally and the cookie has been saved on the
machine because the login page is by-passed (with the Redirect to
"menu.asp" below.

OK - but where is my cookie stored? Or at least give me clue. What
will the cookie be called and what text will it contain if:
iAuthorID = 1
iSecurityLvl = 3
uName = "barny" ?

The machine user is "flintstone " and machine name is "W2KPro". The
CookieName will be "mABmyASPBl og"

== == == == ==

Const SITE_NAME = "my ASP Blog"

If getCookie("mAB" & replaceText(SIT E_NAME, "\W+", "")) Then
Response.Redire ct"menu.asp"
End If

Sub saveCookie(uNam e, CookieName)
Response.Cookie s(CookieName)(" aid") = Session("iAutho rID")
Response.Cookie s(CookieName)(" slvl") = Session("iSecur ityLvl")
Response.Cookie s(CookieName)(" login") = uName
Response.Cookie s(CookieName).E xpires = DateAdd("m",3,N ow)
End Sub

Function getCookie(Cooki eName)
Dim iAuthorID, iSecurityLvl, userName, sSQL, rsAuthor
iAuthorID = Request.Cookies (CookieName)("a id")
iSecurityLvl = Request.Cookies (CookieName)("s lvl")
userName = Request.Cookies (CookieName)("l ogin")

If IsWholeNumber(i AuthorID) And IsWholeNumber(i SecurityLvl)
And userName > "" Then
sSQL = "SELECT author_ID FROM tblAuthors" &_
" WHERE userName =" & fixSQLQuotes(us erName) &_
" AND author_ID =" & iAuthorID &_
" AND security_ID =" & iSecurityLvl
Set rsAuthor = doAdoRs("Blog", sSql, 0, 1)
If Not (rsAuthor Is Nothing) Then
If Not(rsAuthor.EO F Or rsAuthor.BOF) Then
Session("iAutho rID") = iAuthorID
Session("iSecur ityLvl") = iSecurityLvl
saveCookie userName, CookieName
getCookie = True
Exit Function
End If
End If
End If
getCookie = False
End Function

Jul 19 '05 #2
The cookie is stored in the location defined at
HKCU\Software\M icrosoft\Window s\Currentversio n\Explorer\Shel lFolders\Cookie s
in the registry. In NTx, this would be %userprofile%\c ookies. 9x would be
\Windows\cookie s, I'm guessing. The filename is
<yourusername>@ nameofdomain[#].txt, probably. You can open the cookie in
Notepad and decipher some of it.

Ray at work

"mark4asp" <ma************ ****@ntlworld.c om> wrote in message
news:6c******** *************** *********@4ax.c om...
Hello,

I'm running my script locally and the cookie has been saved on the
machine because the login page is by-passed (with the Redirect to
"menu.asp" below.

OK - but where is my cookie stored? Or at least give me clue. What
will the cookie be called and what text will it contain if:
iAuthorID = 1
iSecurityLvl = 3

Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
3821
by: socialism001 | last post by:
I'm trying to store a value in a cookie but its not working. Can anyone see what I might be doing wrong. Thanks, Chris ~~~~~~~~~~~~~~~~~~ <script language="javascript"> if(document.cookie.indexOf("beenHere1=true")!=-1) else
6
2117
by: Marcus | last post by:
Hello all, This is baffling me. I am starting a session and I know it is setting a cookie on my computer - I called getallheaders() and see that it is setting the cookie, and it is also accessible in $_COOKIE. I cleared all cookies in my Cookies folder before starting the session, and everytime I run the script it does not create a cookie in the folder. For testing I even set the browser to accept all cookies to make sure. ...
21
3041
by: puzzlecracker | last post by:
Guys - Is it possible to find which way system stack grows? Perhaps, I am not precise enough: When a function is called, the return address of (callee) function is put on the stack. Thus, the question is the direction where that stack heading (address increasing or decreasing). How would you implement this in cpp? any suggestion.
15
2293
by: amit.man | last post by:
Hi, i have newbie qestion, when i write #include <somthing.h> the precompiler subtitue that line with the lines from "somthing.h" header file. when, where and how the compiler insert the lines in "somthing.c" implementation file into my source code?
3
12711
by: mosesdinakaran | last post by:
Hi Where does the cookies stored in the client machine that php creates after calling session_start() function. I am using IE... I checked in the following folders but no cookies are stored. 1)C:\Documents and Settings\Administrator\Local Settings\Temporary Internet Files
0
1214
by: vilebuzz | last post by:
I sell on ebay alot and I'm starting to search online to find other options to sell computers. What I mainly do is buy used desktops and upgrade them w/ better/newer parts for resale. But do to ebays overwhelming fees racking up every month I've started to look else where. I have since found a site called usfreeads that I have an account w/ thats working fairly well for me as a seller ( http://www.usfreeads.com/_electronics/?affid=18156...
2
1682
by: vilebuzz | last post by:
I sell on ebay alot and I'm starting to search online to find other options to sell computers. What I mainly do is buy used desktops and upgrade them w/ better/newer parts for resale. But do to ebays overwhelming fees racking up every month I've started to look else where. I have since found a site called usfreeads that I have an account w/ thats working fairly well for me as a seller ( http://www.usfreeads.com/_electronics/?affid=18156...
4
1729
by: municipal | last post by:
Hi, I have this following code in my html page <div class="container"> <div ... </div> <div class="container"> <div ... </div>
9
3718
by: DanielJohnson | last post by:
I am wondering where does the value returned by main goes. Suppoes main returns some number say 42, where is it stored. Supposed a shell script call a C program and the program returns the value 42 where is this value stored in memory ?
0
8996
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9566
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9388
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9254
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8256
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6078
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4608
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2791
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2217
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.