Cookies On Localhost, Path & Expiry Issues

suppose i have a script which sets a cookie in this manner:

Response.Cookies("session_id") = '12345'
Response.Cookies("session_id").Expires = <future date here>
Response.Cookies("session_id").Path = "/"

and another script which clears it like this

Response.Cookies("session_id") = ""

The scripts are located in a directory "mysite" under iis root directory
and accessed through http://localhost/mysite/something.asp

When these are called repeatedly, everything works as expected
(script number 1 sets the cookie and number 2 clears it)

However, when I create a virtual directory called "mysite" and point it
to the same place, script number one is no longer able to set the cookie
after script number two has been called, even though they are still accessed
exactly the same way (http://localhost/mysite/something.asp)

But when I modify the code in script number one by removing the last two lines
("expires" and "path") it works as expected again.

View Replies


ADVERTISEMENT

Regarding Cookies Expiry

I got stuck with some cookies expiry date. I wanted my cookies to expired every 4 hours. I'm writing with ASP. Currently I'm using the below code:

Response.Cookies("announcement").Expires = date + 1

for the expiry of everyday. How can I write if I want the cookies to expire every 4 hours?

View Replies View Related

Cookies Expiry Date

I want to create a cookie that remembers the member's log in password and username. But i do not know how to set an expiry for the cookie. I understand that if I set to the one below, when the user closes and reopens the browser, he will still be logged in. But i wish to let the cookie expire once the browser is closed. How can i specify that?

Response.Cookies( theName ).Expires = "July 31, 2008"

View Replies View Related

Role Of "path" In Cookies

Iam modified on of the existing code and found these lines of code

Response.Cookies("FORUM").Path = "/discussion"
Response.Cookies("FORUM")(strForumID) = strListStatus

what does the first line .Path does?

View Replies View Related

Page Expiry

I have developed a portal wherein a user is allowed to access certain areas only through an id and password. But what happens is that once the user logs in, accesses his areas etc and forgets about it,the back button of the browser enables him to view the last accessed pages,which are restricted through the id/password.

Can someone please tell me how such a situation may be avoided so as to restrict unauthorised access?

View Replies View Related

Expiry Page

I have a form that submits values on fields to an add to database asp page that works fine. However I do not want duplicate values submitted. How can I make the submitting page expire once the results have been successfully passed on to the page that adds the results to the database, so that the user may not submit the same thing again and again. I would like the receiving page make the sending page expire.

View Replies View Related

Database Record Expiry

I have a mysql database and i want to make the records have an expiry time. i'm thinking have a field with the time the record was added and then add another field which is that time + 7 days for example. then on my search results page have some code that only displays records before or on the expiry date.

I've looked for other similar things on the internet but can't find anything relevant. does this sound ok, or does anyone know of a better way to do it?

View Replies View Related

Set Cookie Expiry Date Using JavaScript?

I'm trying to set a cookie expiry date but my script is JS (JavaScript). I've
tried

Response.Cookies("Test").Expires = Date();
Response.Cookies("Test").Expires = Date().toLocaleString();
Response.Cookies("Test").Expires = Date().toString();
Response.Cookies("Test").Expires = Date().toUTCString();

none works. I've seen what bothers IIS is the day name when assigning the expiry
date: "7 février 2004 11:57:57" is ok while "samedi 7 février 2004 11:57:57"
produces an error "Invalid type".

Ok, I could switch to VB Script (which I think I'll do because of the ease of
doing it in that language). But I'd like to know if there are well-known tricks
on using IIS/ASP and cookies expiry date in JavaScript. It seems IIS object
model is unable to recognize (or handle) JavaScript dates...

Might sound a stupid question but I'd like my script to be as platform
independent as possible. Why? I'm running a French version of Windows 2000/IIS5.
I might have to host my web on an English version. Or whatsoever. I wouldn't
like to triturate the date string for it depends on the current locale. If
JavaScript cannot be used without modifying the string I'll switch to VB script.

View Replies View Related

Read Cookie Expiry Date?

How does one read and write the cookie expiration date. At the moment my code is returning a value BUT a garbled value:

'//Write cookie...
Response.Cookies("Propsect").Expires = Date() + 1

'//Read cookie...
ExpDate = Request.cookies("Propsect")
Response.write "Prospect expiry date: " & expDate & "<br>"

Result: u%5Fname=k

Any ideas?

View Replies View Related

To Increase The Asp Scripting Expiry Time

set Server.ScriptTimeout variable to 214783647. it's maximum timeout value. insert the following sentence at start line of your asp file.

<%
Server.ScriptTimeout=2147483647
%>

View Replies View Related

Increase The Scripting Expiry Time

I have an asp application. However, the scripting time is too early too expried. How can I extend the scripting time for an individual asp page, or set for one website.

View Replies View Related

ASP Classic Session Bug, Related To Cookie Expiry

We are working on an old asp project and we noticed that some users get
kicked out of the session right after they log in.

I investigated the issue and I found the cause:
1- The user login successfuly.
2- He gets redirected to the menu screen. that's when I set some
cookies to cookie("cookie name").expires = Now. that when the session
starts to disapear, once the user tries to access other pages (or even
refresh), the ASPSESSIONID cookie disapears.

I did some debugging on the http_cookie collection and looks like the
ASPSESSION disapears once I set the cookie expiration, although I set
the expiration for cookies unrelated to the ASPSESSIONID.

Here is the tricky thing, it works on 90% of the machines, and it
doesn't on other machines, it's also random, so some users who had the
problem, are now able to work on the system and the problem disapeard.

Have you guys ever had this problem, or do you know if it is related to
IE batches or service packs?

View Replies View Related

Physical Path & Virtual Path

I have problem with physical path & virtual path on the server.

<!--#include virtual="country/inc.bottom.asp"-->

In this script it is working.

In all the file i have <!--#include file="../ar-inc.top.asp"--> this script.

I have about 10,000 files in the website.

View Replies View Related

Creating Cookies In Global.asa Session_OnStart But Cannot Read Cookies On Subsequent Pages.

In my Session_OnStart in Global.asa, I am setting some cookies. One
of them, I set as follows:

dim UserID
UserID = Request.ServerVariables("LOGON_USER")
Response.Cookies("User")("ID") = UCASE(UserID)

When I immediately log the cookie value retrieved from
Request.Cookies("User")("ID") into the Windows Event Log, I get the
correct value. However, when I try to retrieve the cookie on the home
page of my application using the same code,

Request.Cookies("User")("ID"), it either cannot find the cookie or
cannot read the value. I am retrieving the cookie before all HTML
headers are written. It is my first statement on the page after
Option Explicit. I have even compared the session IDs. The SessionID
created in the Session_OnStart is the same value as the SessionID on
the home page.

I have read that the Session_OnStart only has access to the
Application, Session and Request objects. It does not explicitly say
that it does not have access to the Response object. Also, I was even
able to use Response.Write's in Global.asa to print out the values
although it looked like it had also stopped the session after I did
so. Cookies are definitely enabled on my machine. I have even tried
setting the session cookie's expiration to be persistent for a few
days to see if it was perhaps expiring before I was able to read it
but this did not work either.

Is there something preventing cookies to be created in Global.asa in
the Session_OnStart sub? Is the Response object not available???
Please let me know if anyone else has had this problem or solution.

View Replies View Related

Enable Permanent Cookies But Disable Session Cookies

Is it possible for a user to enable permanent cookies but disable session cookies.....this seems like a contradition yet this is what I appear to be
reading in online articles?

View Replies View Related

Creating Cookies File And Stored In Cookies Folder

I m creating a cookies in my application and it work properly but i can't see the cookies where it will sotred i checked the cookies folder but i didn't find that I want to create a cookies file as the other web site create and store where other cookies will stored in Cookies folder or Temprory Internet files folder eg:1. arvind@google.co[1].txt this stored in cookies folder 2. arvind@msn[2].txt ....

View Replies View Related

Localhost/IIS

I am trying to test a website that uses ASP on my PC. I am running Windows 2000 and have IIS 5.0 installed.The first page is a form where the user enters a password. When the form is submitted the progress bar indicates something is happening, but I can leave it for 20 minutes and the file has not loaded.

I am using the URL http://localhost/webname /.

I have tested it on 2 servers and the script works. I have had similar problems with other ASP pages and assume the problem is something to do with IIS.I have tried re-installing IIS.

View Replies View Related

Localhost

All this while I have been running my ASP pages on the webserver.
In the web server, I can access the web server through the Internet Services Manager.
Now I want to access these web pages locally, so that I do my development locally and then when it works, I move to the web server.
I have Windows XP Professional 2002
How can I access the web services within this machine?
When I type in http://localhost in this machine, i get the message-Page cannot be displayed. Cannot find server.

View Replies View Related

Localhost...

I just bought a new computer with win XP PRO. I'm trying to set it up so
that I can use it as a local host and with IIS etc. I don't really know where
to start. How do I start running IIS? At this point, pointing to localhost
doesn't work but I'm not sure what I'm supposed to be doing.

View Replies View Related

Localhost ..

I have downloaded this example from this site http://www.iisworks.com/fileman/ i have tried reading the install guide but i still dont understand. I manage to set up localhost in my pc. Anyone who is kind enough to guide me thru step by step....

View Replies View Related

Localhost

I like to learn ASP and database related, how do I practice it at home using XP pro? Like with PHP I use localhost and stuff.

View Replies View Related

Localhost

Is there a way I can run ASP on my localhost? I run a valid copy of Win XP pro, but I do not have the CD as it is a pre-installed version on my Dell Latitude. So, is there a way I can run ASP?

View Replies View Related

Sessions With Localhost

I am working with sessions to check if the user is logged in.
This usually works fine and all my .asp-pages checks if: <%
session.Contents("loggedIn")=True %>

But this only works on my web-hotel
When I run the same pages on my localhost, it can't find any sessions and I
appear to not be logged In.

I have tried to set my localhost on the "trusted sites" list and "always
allow" in "override cookie handling" in my Explorer.

View Replies View Related

Localhost Is Not Being Recognised

when I run my asp programs, suddenly I'm getting the page "page can not be displayed"

when it worked fine till the previous day suddenly what made those pages to be not recognized I didn't understand.

the browser is atleast not able to recognise the "localhost".

View Replies View Related

IIS Version 5.0 Will Not Run ASP On LocalHost

I have a new ASP project that I need to desperately test on my Windows 2000
machine before posing to my Hosting Company. I am having problems getting
the ASP pages to run from LocalHost. I will attempt to give as much
information of what I have done to try to correct this without success.

First my setup. Windows 2000 Professional with Service Pack 2 installed.
IIS is installed. I have turned off the firewall just in case that was a
problem as the laptop is operating as a stand alone and not on a network at
this time. I also have VB6 with Service Pack 6 installed. I will explain
later why that my be pertinent.

The error that I am getting is:

The Page Cannot Be Displayed. with a HTTP 500 error. This occurs every time
I try to access a ASP page. HTML works fine from LocalHost. Code:

View Replies View Related

Localhost Slow

I'm trying to surf on a website on winXP, but IIS response is very slow. It doesn't load a lot of images (red x). Besides, it alerts always there's no connection (from each page to the following), asking whether I want to connect. The browser keeps waiting for images then it fails. What can I do?

View Replies View Related

Localhost Access Is OK But Not IP ADD

I developed a small asp application. My problem is that everytime I use LOCALHOST, accessing and adding data on the database is OK but if I use the IP ADDRESS for accessing the website it would generate this error

Error Type:
Microsoft OLE DB Provider for SQL Server (0x80040E4D)
Login failed for user 'MYSERVERIUSR_MYSERVER'.
/o/dog_evaluation/add_dog_db.asp, line 22

The connection string on my page is this

conn.Provider="Microsoft.Jet.OLEDB.4.0"

conn.Open "Provider=sqloledb;Data Source=MYSERVER;Initial Catalog=dog_evaluation;Integrated Security=SSPI;"

View Replies View Related

Localhost 404 Error

I get the 404 file not found error message when I try
http://localhost/xxxx.asp

I've created a virtual directory and pointed it to the asp
file and the error message appears.

I've tried creating a new directory and received the same
error message when I pointed it to the new asp file. I
think it's something in the IIS configuration. Any ideas?

View Replies View Related

Asp.net And Localhost:8082

my asp.net applications run as

http://localhost:8082/appname/webform.aspx

- i've downloaded a sample aspx solution,
and get the following error when trying to
open it:

"Unable to open web project "FormsAuth". Unable to
validate that the file
path "c:/downloads/ddj/aspnet/aspform/FormsAuth" matches
the url
path 'http://Localhost:/FormsAuth'. A connection with
the server could not be established."

View Replies View Related

Connecting To Localhost

I have got a scenario where an asp script needs to request via xmlhttp a file sitting on the same server. The code all works find on my local machine. However, on the hosting server, it does not. The problem is that I am on a shared server and the server can't "see itself", i.e. it's probably blocked by the host to receive request from itself. The problems comes in as the server will hold multiple sites and use host headers to channel request. I thought of using "localhost" and some kind of header sending scenario to get the server to go to the correct subfolder/virtual host. However, googling has not brought up much.

View Replies View Related

Http://localhost Is Not Available

Installed IIS on w2k pro, started Personal Web server and pointed the home catalogue to the folder with my asp codes. However IE keeps saying that http://localhost is not available without Internet connection. Such thing often happend on other computers, but after several refresh it worked. How shall I get rounf this now?

View Replies View Related

Can't Connect To Localhost

I have installed wamp5 on my laptop so I can develop php pages with mysql.I have started the wamp5 which give you a semi circle and three quarters of the icon is shaded yellow - this is supposed to mean that apache is running. I then type in http://localhost in the address bar and I get the "page cannot be displayed" error.

This is weird because wamp says apache is running ok.Is there any other setting that may affect the connection?If this is any help, I also have a sneaky suspicion that because I have visual studio.net installed on my laptop there may be a conflict with IIS? I have not developed any sites with visual studio yet but could there be a conflict here? Thing is, I am not sure what to look for or change?

View Replies View Related

Localhost On Mozilla

I try to run localhost on other browser other than IE, in this case i run on FireFox Mozilla.Can anyone tell me why does the browser popup with the security windows where i need to type a Username and password. However, that wouldn't happen if i run on IE. Is there a special setting where IIS can check whether a user run scripts on that type of server on other browsers than IE.

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved