I need help with cookies in asp. I need to set a cookie that will expire midnight today which would actually be tommorow. I'm having hard time with the date time functions can someone help me out. what would I write?
If I open any other website and open my application, Session get expires. If I open my application first and open any other website, then Session in my application is working properly.
I have an asp application which uses IIS 5 . I need to expire my session in 10 minutes . I use session.expire=10 in my index.html page. when the session is expired in 10 minutes i need to redirect the respons to the login page agein.how can i do this.
i have admin panel and agent panel. when i open admin panel and log in it works fine. but when agent opens agent panel in different pc and login and acts something like open a page or so, both admin panel and agent panel expires session and asks for re-login. What would be possible reason for this?
platform: OS: windows 2000 server, IIS 6.0 Script : ASP, Javascript Database: MsSql 2000 Server
At the moment, I have this in the footer section of my login protected pages:
<%Response.Expires=-1%>
But I notice this doesn't prevent me from being able to press 'Back' after I have logged out and view the same content - content I should not view if Ihave logged out! How do I force the page to expire then?
I am creating an access DB that has job listings and displays the DB online.
I am creating tables rows for 'BeginListing' and 'Endlisitng' etc that are stored as a Date
How do I get the asp/vbscript to check the date 'EndListing' of the entry and to stop displaying it when the date is later than today (so it takes them offline when the date is expired)?
My script is like this and loops through each record set displaying the contents: ...
I use Response.Expires=0 in asp code. This was working fine in production for some time on a windows 2000 server. In the last month is code is not working any more the page does not expire it has a expiry time of 10 minutes. Could a server update cause this code not to work? or do you have any ideas why this is not working?
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?
If i try to alert the value of the cookie in the same page, it shows the old value. As well as when it is alerted from the login.asp it shows the old value.
The problem is when i try to update the value of the cookie in the login page, it does not update the new value.
Only if i close the browser and reopen, the new value gets updated and even if the old value is originally present in the cookie.
I am specifying the domain and path when creating the cookie. the expires property is set to date + 1 when creating.
What should be done to delete the contents of the cookie? Should i specify the domain as well as path when changing the expires property?
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 %>
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?
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.
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.
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?
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.
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 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:
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): ....
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.
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.
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? .....
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?)