How To Set Cookie To Nothing?
The problem is that the code for "change_school.asp" takes the user right to "portal.asp". I checked the code of "change_school.asp" and it does indeed set a cookie value for "school", but for some reason "default.asp" is still finding the old cookie stored and then redirecting...any ideas guys? 'code for change_school.asp...clears the cookie "school" and redirects to page (default.asp) where user can select a new school <% Response.Cookies("school")= "" Response.Redirect "default.asp" %> 'code for default.asp which allows user to select a new school, and if the cookie "school" has some value then they are redirected. <% If request.cookies("school") <> "" then Response.Redirect "portal.asp" end if %>
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Response.cookie In Session_onstart Event And IE 6.0 Cookie Acceptance
When I set a cookie in global.asa in the sub session_onstart, even if I have "privacy" in IE 6.X set to "block all cookies" the cookie is still set, and I can get it on other pages. I can't find an article that addresses this as a specific issue. Why does the browser get the cookie when it is set in the session_onstart event even when I have "block all cookies" set?
Session Cookie Vs. Regular Cookie
I want to know what's the differences between session cookie and regular cookie. In ASP, when we create cookie, we do the following to identify an user: Response.Cookies("name") = value Is this regular cookie? How about session cookie? and when to use which?
Cookie And SQL?
On this website i am building it has password protection on certain pages. So i have a "login" portion on the right side of the page, that is shown on every page. When someone logs in is it possible to change that little section to just say Welcome so and so? Instead of having the username and password form with submit button?? Or is this something that requires some java to hide it? Part II When someone logs in i want them to recieve a cookie, in that cookie i want it to contain the person's name (wich i want the to be put next to the "welcome back on part I), email address, and up to four other numerical values. (some people will have greater access to sections of the site depending on who they are) Is is possible to grab this information from the SQL database and put in the cookie? If so can anyone please show me, point me in right direction, ect?
Cookie Value
I'm using FrontPage Database results wizards to retrieve data from Access. I have a cookie containing a number I'd like to insert in a custom query. Whenever the page opens, I want the query to run using the value in the cookie. I haven't been able to figure out how to transfer the cookie value into something the FP webbot will accept in the query.
Cookie
What i am trying to do is this: I want to make a cookie. If someone comes back to a page (say after an hour after they left)i want them to get a specific popup. If someone comes back after than hour I want them to get a different popup, telling them something different.
Cookie Detection
I'm going to go down this route of Cookie detection <% If Request.Querystring("Check") = "" Then Session("cookietest") = "True" Response.Redirect("cookietest.asp?Check=True") Else If Session("cookietest") Then <!-- Execute code if enabled --> Else <!-- Execute code if disabled --> End If End If %> I’m a little worried, do you know how spiders work with regards to this sort of thing? My site gets some traffic due to it being spidered by the likes of google and I don’t want to loose that flow. If I use this at the entry point of my site to redirect browsers with cookies turned off to a page telling them to turn them on will that stop the spiders?
Cookie Availability
If my user turns cookies off, both permanent and temporary cookies can't be used or only permanent cookies can't be saved on the user's machine?
Cookie Not Being Deleted.. How Do I?
I have a cookie with a path of "/" im trieng to delete it before the expired time has comed anyway i am trieng to delete it by setting the cookie to "" like so: Response.Cookies("name") = ""; but its not working but...i found out that if i dont set the path it is being deleted but i have to set the path because from some reason without it i have issues where the cookie is not found in some pages.
A Cookie Disappears, But Not All Of Them
I have a problem with a Cookie in an ASP page. Without any apparent reason, one of the Cookies disappears, but the others are ok. I'm at Page1, a link goes to Page2. Page2 redirects to Page3 and Page3 redirects to Page1. When I'm back to Page1, sometime, one of the cookies don't exist anymore... But the others are there! The disappeared Cookie isn't always the same, in the 18 Cookies that I have. The environment is composed of 4 clustered servers. Page1 is SSL, but not Page2 and Page3. I don't have more than 4KB (1.86KB to be more precise) of data and I don't have more that 20 Cookies on the same domain. I added the following code:
Retrieving Cookie Value
I want to retrieve the value of a cookie to make a form a little more user friendly (our intranet is configured to set a cookie for User First Name, Last Name and Email when they log in) Unfortunately I can't figure out how to retrieve the value of the cookie. I've been trying: <% Response.write Request.Cookies(UserLName) %> But it gives me an error - I used Checky to make sure the cookies are there and they do exist: Name:mascot Value: UserLName=Tarby Can someone give me some advice?
Encoding Cookie.
When I run the ASP page for the first time, I find out, that the Cookie file name contains some several special characters such as %5F, which are encoded with a URLEncode function. So, I have the following string (after convert): ....
How To Remove Cookie?
How can I remove a cookie from the client in ASP? I'm not talking about setting the value to a blank string and I've tried this: [vbs] Response.Cookies("mycookie").Expires = Now() [/vbs] and [vbs] Response.Cookies("mycookie").Expires = Date() - 100 [/vbs] Neither of which work. Is there any way to completley remove the cookie?
Cookie Array
Is there a way to store an array of information in a cookie? ie. a user can have a "x" long list of a variable stored in a cookie, so when they return to the site this information can be retrieved.
Get Cookie Path
Is it possible to get the physical path of a cookie? (C:Document and SettingsmyLoginCookies) Because I need "myLogin" (the Windows Login), and I can't get with request.ServerVariables("logon_user") or ("author_user") or whatever...
Write Db Value To A Cookie?
I select 'name' from the customer table. Is it possible to write it into a cookie? <% Response.Cookies("customer")("firstname") = '" & objRecordset(NAME) & "' %> when I try to write the above using <% Response.Write (Request.Cookies("customer")("firstname")) %> i get the following ....
Cookie Testing
I need to revisit cookie testing. On the home page and every product page I write a cookie. I do this because some users enter by direct links to product pages. <% Response.Cookies("cookietest") = ("49") Response.Cookies("cookietest").Expires = Date + 2 %> On the cart page I test for the cookie... <% If Request.Cookies("cookietest") <"49" Then Response.Redirect("err.asp?e=1") End If %> I have a user that insists he has cookies enabled, yet he keeps getting redirected to my error page which suggests he does not have cookies enabled. What could cause this? Is the above too simple for all circumstances? Is there more extensive code that I could setup on a hidden page where I can send users to get read out on how they actually have their browsers setup? i.e. Run a test on their browser and the results are emailed to me.
Creating A New Cookie
I have an asp page where i created cookies-for admin and for user. The aspx page reads these cookies. Everything seems to work fine but now i have to create a new cookie if cookie has expired or if cookie is null. Also, i am having problems with the expire because if the username belongs to the admin for example and then i want to change the username that belongs to a normal user the cookie recognises the first (admin) cookie. How do i solve this? .....
Cookie Poisoning
I have created a page where i got sth like this: if (request.cookies("example") <> "" response.redirect("login.asp") response.end end if (I will try to explain as easy i can), so in the login.asp using a .mdb i get the username and check with the password, and putting the username in the cookie in this case called example, but using some cookie poisoning i can be anybody logged in, even sb out of the table of users, i didn't use the session object, i wanted to use a cookie because i got curiosity and i didn't understand what is the difference, and actually i don't understand so much...anyways i got 2 questions, how i do sth for protect the cookie for cookie poisoning and what is the difference between the session and the cookie (from the little what i know is that the session is a predefined cookie that has some encrypting stuff and that so on and got some properties, methods right? and the cookie is just a information holder without any extra stuff as the session object has, am i right?)
Encrpyt A Cookie
I have created code to create a cookie about a user when their login and when they tick a remember me box. The problem is though the the data in the cookie is stored in plain text. Which means I can use firefox and it webdeveloper tool to look at the cookie and change the values. My question is how do you encrpyt a cookie so it doesnt store the info in plain text?
Cookie Abandon
well in session we got session.abandon and all the bad sessions gone... i need to delete cookies from users side, there is option for this in asp dot net but in classic asp how we can do it? Response.Cookies("firstname").Expires=?
Cookie Not Being Prompted
I use the following simple code in an asp to test how cookies work ... <%@ Language=VBScript %> <% Response.Cookies("CookieTest")="Lovely Cookie !" Response.Cookies("CookieTest").Expires=DateAdd("n",5,Now()) %> <HTML><BODY>The cookie has arrived !</BODY></HTML> I've set my IE6.0 to prompt me for all cookies, which it does for all web pages I visit, but not for the above asp page which is hosted from IIS5.1 on my PC. I can see the cookie being created in my Cookies folder, but would like to be prompted first!
Cookie Problems
I''m having a problem with cookies that is driving me insane :). - If a user comes to http://domain.com and a cookie is set for them, then the user for whatever reason jumps to http://www.domain.com one of the 2 happens: 1) The cookie we set can not be read (expected), but then a new one can not be written ether (I looked at the server headers and although the cookie information is sent, IE ignores it). 2) The cookie from http://domain.com can be read, but you can not write to this cookie. Same here cookie is sent back from the server but IE ignores it. Now, if its the other way around. If a user comes to http://www.domain.com, a cookie is set, then he/she jumps to http://domain.com: The cookie can not be read (expected), but a new one can be written (as it should be). So after driving my self insane, i whent out and tried it out in other servers to see if it was true. I tried 4 different sites which used cookies (for shopping carts). I did the same tests, (Go in via domain.com, add something to cart, then, jump to www.domain.com, cookie would not be overwritten. Then did the other way around, everything worked fine.) Sample code: .....
Cookie Test?
I have always used this in ASP to test if the client is accepting cookies: <%@language="VBScript"%> <% Session ("nc") = 1 If Len(Session("nc")) = 0 Then 'Cookies Off Else 'Cookies On End If %> But I only ever tested it in Microsoft Internet Explorer 6 though not sure. Anyway with Microsoft Internet Explorer 5.5 SP2 Len(Session("nc")) <> 0 always whether cookies are on or off. Can anyone suggest a better cookie test that will work in most browsers?
Reading A Cookie Value?
am trying to create a login page for the first time, I have a login page, validate login page and if the password is correct it takes me to the first page. I have customized this code someone else created,but what I have a problem with now is I need to log who submitted that data and that is why I am trying to read UserName cookie so I can later match that data. This is the error I get which is telling me that it is reading the cookie since this is the UserName I am logging in with Microsoft OLE DB Provider for ODBC Drivers (0x80040E14) [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid column name 'boxhill'. but I can't see what is wrong, and there is not much out there for this kind of error. So I can login successfully but now i need to read and dispaly that cookie and then insert the value of the cookie but,but don't worry about that now, just trying to give you the full picture. So this is the code for reading the cookie ...
Cookie.Path
I'm writing an ASP validation script that uses a cookie that is created by a user validation page and has a single value. This site will be used only under Internet Explorer 5 and more recent. My problem is that the page called after the cookie creation can't read the cookie unless I set the Cookie.Path attribute to "". All the documentation that I found about it is very brief, don't explain how it really works and if there's any kind of "side effects". An even stranger fact is that some people of my team can read the cookie without setting the Cookie.Path attribute. Can anyone tell me how the Cookie.Path really works or witch browser settings make it needed (or not)?
Session Or Cookie? Which Is Better?
Can anyone tell me the difference between Session and Cookie? Does Application Object and Session works the same way? How do we know when to use Session and cookie?
Possible To Pass Cookie Value From VB To ASP?
I want to pass the value of the cookie created in VB to ASP. This doesn't work. Any idea? <script language=vbscript> document.cookie="mycookie" ' also tried with document.cookie="name=mycookie" </script> <% z=request.cookies("mycookie") response.write(z) %> ....
Using Response.cookie
Having just migrated to w2k from NT4, I've stumbled across an oddity with cookie handling - at least, that's what it appears to be. I (was) using response.buffer with .addheader to write two cookies into a the http header for a particular page . Worked fine for three years. After the upgrade, I'm finding that two copies of the same cookie appear, one with blanks for values, the other with values filled in; this has the effect of logging the user into the page if the first copy isn't blank.... So, I changed the code to use response.cookie, which is fine, but the names/values get encoded, and unfortunately the software vendor uses dashes in the name part. Is there any way to force .cookie to not encode the '-'? or do I need to look at javascript to write the cookie?
Cookie Security ?
I'm not really asking about "someone stole my credit card info through cookies". Here's the deal: I have 2 sites (different domain names) running from one server. One is SSL the other is not. The SSL site has a login and password, which return the user's unique id, which is stuck into a session cookie. This cookie is then checked at every page because every page is built based on the user's id. If it is not present, the user is redirected to the login page. If the id is wrong, there will be no information shown on the page. My question is this, can the other (non-SSL) web site see this cookie? The site has no asp or anything else, but if someone "broke into" the non-secure site, could they read the cookie from the other site?
Response.Cookie
I am trying to add some basic security to my asp web pages. I have a logon screen which, when the logon and password are checked for validity, passes the user on to a registration screen using the code response.Redirect "user_reg.asp?User=" & Request.Form("UserName") I then inserted the following line before the redirect response.Cookies("ValidUser") = "ValidUser" I have the following check at the start of the user_reg.asp page <% if request.Cookies("ValidUser") <> "VaildUser" then response.redirect "user_login.asp" End if %> All that happens now is that when I log in validly user_login.asp is redisplayed rather than the user_reg.asp. Perhaps this is not sufficient to set the cookie? I have looked for it but can't see it amoungst other cookies dated today.
Testing For A Cookie
I know very little about ASP and ASPX pagfes but i inherited a web site done by a guy who knew just a little more than me and I've worked around things with my knowledge of HTML and Javascript, as well as added on to the web site using Cold Fusion. But I am at a point that I need to be able to do more. I have a ASPX page with a Log In button that I don't want see if a certain cookie exists. Is there a way to test for that cookie on the page and display or not display something based on that test?
Cookie Won't Persist In IE
(I'm not sure if this is the right forum for my post - my question is about vbscript, but I didn't see any vbscript forum, so here goes.) I've created a registration page on my website which gets called from a number of links on the site - I want to capture user information before allowing them access to these sections of the site. Once a user has registered, I want to recognise that fact when they click on any of the other links, so I'm setting a cookie. However, while it works fine in Firefox, it won't persist in IE - even across a single session. Here's the code I'm using : In the 'Thank you for registering' page, the very first lines on the page are : <% Response.Cookies("Registered") = "True" Response.Cookies("Registered").Expires = Date + 1000 %> Where the links that require registration appear on the site, I am building the <a href> tag as follows : <a href= <% if Request.Cookies("Registered") = "True" then %> "PageX.asp" <% else %> "Register.asp?RequestedArea=ReportDesign" <% end if %> class="bodyLink">Report Design</a> but it keeps going to the Else part - ie. it's not finding that the Registered cookie has a value of True.
Remember Me Cookie
I am sure this is a simple process, however just cant seem to break it. I am new to asp and am trying to learn by trial and error. I cannot get this remember me check box to "remember me". Does anyone know what I am doing wrong? code from form on login page:
Cookie From Frameset
I have developed a site that uses cookies for a low-security login system, which works fine. The client now wants to put the entire site inside a frameset, with the parent page on another server, but when we do this the cookies are set (i can see them in netscapes cookie list) but then cannot be read. is this a domain problem? is there any way around this? I've been seeing a few things on p3p that might make this hard...
The Cookie Is Crumbling...
I am using the following code to create a cookie: Response.Cookies("bookedby")= Request.Form("txtBookedBy") Response.Cookies("bookedby").expires="#July 29, 2003#" However, when the page is opened I get the following error: Error Type: Microsoft VBScript runtime (0x800A000D) Type mismatch: 'Response.Cookies(...).Expires' /MRBS/addbookingtodb.asp, line 5 Line 5 is when I try to set the expiry.
Cookie Security
If I store login information in a cookie is it possible for the PC owner to modify the cookie without it making it valid? For example if in the cookie I store the current user, say "Bob" - if Bob edits his cookie by hand to say "Alan" will the server accept the cookie as valid? Or will it realise that it has been tampered with and discard it? Anyone recommend a good reference on this sort of thing?
Simple Cookie
I have this little flash movie on the main page of a website and I want to set the cookie so that when user first enters the site, the flash plays but when the user browses around and goes back to the main page, the flash movie won't repeat again ... kinda like ........ they can only see the movie 1 time when first entering the site but after that they won't be able to see it again unless they clear their cookies from their computer
Writing Cookie
I've been having problem writing a cookie. Everything goes ok but when I supply the .Path property to "/" It just write the cookie when there is no cookie present, but when I try to update the cookie (or overwrite the cookie) it doesnt change it.My requirement to supply the path to "/" because ASP.NET reads it. If I write the cookie without supplying the path, the ASP.NET pages are unable to read the cookie.
Cookie Problems
I have a techincal support form. And when the user hits submit i want to give them a cookie. When they try to access this page again in a 24-48 hour time I want the page to identify the cookie and redirect them to an alternative page. Yet i am having a problem with the page. Here is my code for the to give the cookie: Dim prod prod = "test" Response.Cookies("testing")= prod Response.Cookies("testing").Expires = Date + 1 Here is the code to read the cookie: dim show, verify verify = "test" show = Request.Cookies("testing") If verify = show Then Response.Redirect "http://www.google.com" End If Any suggestions?
Checking If A Cookie Has Already Been Set
I just want to check that i'm not going crazy.. I want to check whether or not a cookie has already been set and so I am using the following code. cookieValue = Request.Cookies("CartID") 'if cookie hasn't already been set, then set it! If cookieValue = "" Then Response.Cookies("CartID") = "3" Response.Cookies("CartID").Expires = "Jan 1, 2005" End if I have also used IsNull yet both just don't seem to work.... am I missing something here?
Expiring A Cookie
I want to know how do I set the expiration date of a cookie to a future date. Like I know that its likeCode: Response.Cookies("hi").Expires = date But the question is how do I set the date??
Empty Cookie!
I have a login page where I have three different ways to authenticate a user. 1. Use integrated authentication and read the server variable AUTH_USER and then verify if this is a valid user from a database. If OK I write some session cookies and then re-direct to another page placed in the same folder (which will read the cookie and verify that it is valid). This works OK. 2. Use anonymous login where the user is typing in a username/password which is checked against a database and if OK I write session cookies and then re-direct to other page which reads this cookie. This also work OK. 3. Now we read another server variable that is set by a third party oracle product (don't know much about this product but when I print the value of the servervariable it is OK). I write some cookies and then redirect to another page. When I read the cookie now it is empty. If I read the cookie just before I do my re-direct it is OK but after the re-direct it is empty. Do you have any sugestion why the cookie becomes emtpy after the re-direct in the third case but not in the other two? It is the same code doing the actual reading/writing of the cookies in all three options above.
Deleting Cookie
I'd like to have a remove all button in my shopping cart. is it possible to delete a cookie with asp?
Retrieve Value From Cookie
If i have got a cookie which stores the username and password of a user, how do I retrieve the values, e.g. I want to retrieve the username. My page so far is: ....
Session Or Cookie ?
I am not asp specialist and i was wondering what to choose - session or a cookie. the idea is to make something like a shop but without the function "remember me" ... more like "in memory" cookies. so apparently i will have to use a session or a "in memory" cookie but which one is better. as to my knowledge the session does not differ dramaticaly from the cookie because it uses because as u know it is based on cookies. however why should i use session instead of cookies if the result will be exact the same i.e. if browser does not support cookies the whole thing won't work out?
|