473,396 Members | 1,898 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Cookies & Localhost

I have an application where we have a limited number of users and a set
requirement for web access. An app that I have inherited uses cookies to
set certain values (i.e. what would correspond to session variables in
regular ASP) that we use to run reports from a SQL database and display them
in a web browser.

In doing some testing, I noticed that the cookies would remain there for
previous used (if I signed into our app as user 1 and then user 2, user 1's
data would be retained for user2), if I didn't manually delete cookies from
the web browser or initiate a new web browser.

What I wanted to do was to expire all of the cookies for our web app when
the default page was loaded, to ensure that we got a fresh start from there.
However, I can't seem to find them on my localhost.

In testing, I set these 3 cookies in my web page:
Response.Cookies("availabilityrptlevel").Value = "10"

Response.Cookies("sg_sku").Value = 0

Response.Cookies("le_sku").Value = 0

and then read them in elsewhere:

prmfaavailability.Value = Request.Cookies("availabilityrptlevel").Value

Can what I want to do be done? Where do I find these cookies on my
localhost?

BC


Nov 18 '05 #1
2 2991
If you want to delete your cookies when the default page is loaded try
expiring them using the following:

Dim exCookie as HttpCookie = Request.Cookies("availabilityrptlevel")

If exCookie Is Not Null
exCookie.Expires = DateTime.Now.AddDays(-10)
Response.Cookies.Add(exCookie)
End If

"Goober" <me@privacy.net> wrote in message
news:Ot**************@TK2MSFTNGP11.phx.gbl...
I have an application where we have a limited number of users and a set
requirement for web access. An app that I have inherited uses cookies to
set certain values (i.e. what would correspond to session variables in
regular ASP) that we use to run reports from a SQL database and display
them
in a web browser.

In doing some testing, I noticed that the cookies would remain there for
previous used (if I signed into our app as user 1 and then user 2, user
1's
data would be retained for user2), if I didn't manually delete cookies
from
the web browser or initiate a new web browser.

What I wanted to do was to expire all of the cookies for our web app when
the default page was loaded, to ensure that we got a fresh start from
there.
However, I can't seem to find them on my localhost.

In testing, I set these 3 cookies in my web page:
Response.Cookies("availabilityrptlevel").Value = "10"

Response.Cookies("sg_sku").Value = 0

Response.Cookies("le_sku").Value = 0

and then read them in elsewhere:

prmfaavailability.Value = Request.Cookies("availabilityrptlevel").Value

Can what I want to do be done? Where do I find these cookies on my
localhost?

BC


Nov 18 '05 #2
Visual Studio doesn't like that and gives me an error on it. It says,

'null' is not declared. 'Null' constant is no longer supported; use
'System.DBNull' instead.

If I change the Null to System.dbnull, it says,
'DBNull' is a type in 'System' and cannot be used as an expression.

If I change it to System.convert.dbnull, it doesn't give me an error in
Visual Studio, but I get a runtime error:

Operator is not valid for type 'DBNull'.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.InvalidCastException: Operator is not valid for
type 'DBNull'.
BC

"Janaka" <ja*****@hotmail.com> wrote in message
news:O5**************@TK2MSFTNGP09.phx.gbl...
If you want to delete your cookies when the default page is loaded try
expiring them using the following:

Dim exCookie as HttpCookie = Request.Cookies("availabilityrptlevel")

If exCookie Is Not Null
exCookie.Expires = DateTime.Now.AddDays(-10)
Response.Cookies.Add(exCookie)
End If

"Goober" <me@privacy.net> wrote in message
news:Ot**************@TK2MSFTNGP11.phx.gbl...
I have an application where we have a limited number of users and a set
requirement for web access. An app that I have inherited uses cookies to set certain values (i.e. what would correspond to session variables in
regular ASP) that we use to run reports from a SQL database and display
them
in a web browser.

In doing some testing, I noticed that the cookies would remain there for
previous used (if I signed into our app as user 1 and then user 2, user
1's
data would be retained for user2), if I didn't manually delete cookies
from
the web browser or initiate a new web browser.

What I wanted to do was to expire all of the cookies for our web app when the default page was loaded, to ensure that we got a fresh start from
there.
However, I can't seem to find them on my localhost.

In testing, I set these 3 cookies in my web page:
Response.Cookies("availabilityrptlevel").Value = "10"

Response.Cookies("sg_sku").Value = 0

Response.Cookies("le_sku").Value = 0

and then read them in elsewhere:

prmfaavailability.Value = Request.Cookies("availabilityrptlevel").Value

Can what I want to do be done? Where do I find these cookies on my
localhost?

BC



Nov 18 '05 #3

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

Similar topics

4
by: Eifion | last post by:
I've noticed a strange problem with setting cookies in ASP when the cookie name you're setting exists in the querystring. The company I work for has many partner sites who link to our site like...
4
by: Vince C. | last post by:
Hi. I'm trying to work with cookies from ASP and I've noticed cookies are stored on my machine in two distinct forms. the first form is "Cookie:<user name>@<web site>", which is a combination...
1
by: Ravi | last post by:
Hi , i am trying to pass the same session Id to all the webrequest, but sometimes the response.cookies returns zero and sometimes one. is this to do something with cookies expire. In this sample...
1
by: Peter Row | last post by:
Hi, I have a web app, there is only really 1 aspx page (that the user never sees) the rest of the code is done in a DLL that implements HttpHandler. My app (which is a porting job from Vb6...
2
by: Raterus | last post by:
Howdy, I have one IIS Application, with asp/asp.net pages. I set a cookie like so in an ASP page. Response.Cookies("AuthCookie")("hash") = md5(username & Application("HashCode"))...
0
by: Mach Runner | last post by:
I am implementing a secure website using the ASP.NET FormsAuthentication model. I have taken the simplest code examples from MSDN (login.aspx,default.aspx, web.config) but cannot get proper...
1
by: stillworkingfortheman | last post by:
I'm loosing cookies in IE6 (works in firefox) when with the following steps... step 1. set a cookie in one domain, in an .aspx.cs codebehind... in www.domain.com/subdomain1/page1.aspx...
0
by: stillworkingfortheman | last post by:
I'm loosing cookies in IE6 (works okay with firefox) with the following steps... step 1. set a cookie in one domain, in an .aspx.cs codebehind... in www.domain.com/subdomain1/page1.aspx...
14
by: vjayis | last post by:
Hi i m using cookies to store data in an form containing textfields and using the following codes., <?
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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,...

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.