Pablo Software Solutions Forum Index Pablo Software Solutions

 
 FAQFAQ   SearchSearch   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Persistent Cookies

 
Post new topic   Reply to topic    Pablo Software Solutions Forum Index -> Quick 'n Easy Web Server
View previous topic :: View next topic  
Author Message
dnadave



Joined: 19 Jun 2006
Posts: 3

PostPosted: Mon Jun 19, 2006 5:31 pm    Post subject: Persistent Cookies Reply with quote

I'm currently trying to learn ASP and BabyWS has worked great for me. Except, I did come across one issue.

I am using the following code to set a cookie to "dave"...

<% Response.Cookies("loginuser")="dave" %>
<% Response.Cookies("loginuser").Expires = Now() + 100 %>

I am using the following code to check for that same cookie...

<% if (Response.Cookies("loginuser")="") then %>
No Cookie
<% else %>
<%= Response.Cookies("loginuser") %></a>
<% end if %>

For some reason, it is acting like a Session object. The cookie is removed when I close the browser. Any thoughts?

-Dave
Back to top
View user's profile Send private message
admin
Site Admin


Joined: 13 Apr 2005
Posts: 1470

PostPosted: Mon Jun 19, 2006 9:00 pm    Post subject: Reply with quote

Note that cookies are a feature of your browser, so it's up to your browser if it will store the cookie or not (based on your security settings).

Usually the .Expires method is used this way:
Code:
Response.Cookie("loginuser").Expires = DateAdd("d", 7, Now())

or
Code:
Response.Cookies("loginuser").expires = #12/31/2029 00:00:00#

I'm not sure if VBSCRIPT will understand that Now() + 100 should result in a date.
Back to top
View user's profile Send private message Send e-mail
dnadave



Joined: 19 Jun 2006
Posts: 3

PostPosted: Tue Jun 20, 2006 6:53 pm    Post subject: Sill no solution Reply with quote

I tried your suggestions and they set Session Cookies as well, not Persistent Cookies.

I know my browser allows for persistent cookies, because many other websites track my login/password without me having to login (and I see the cookies on my machine).

Where are Cookies stored on the machine when generated in ASP by BabyWS?
Back to top
View user's profile Send private message
admin
Site Admin


Joined: 13 Apr 2005
Posts: 1470

PostPosted: Tue Jun 20, 2006 8:58 pm    Post subject: Reply with quote

Like I said in my previous message, cookies are a feature of your browser, so depending on the type of browser you use, the location where the cookies are stored is different. BabyWebServer only controls the content of the cookie file but not it's location or filename.

IE normally stores cookies in your personal folder:
C:\Documents and Settings\YourName\Cookies
The name depends on the URL you used to access the server.
For example:
http://127.0.0.1
results in a cookie file:
yourname@127.0.0.1.txt

Once again, this may be different depending on your browser configuration, (local) security settings.

Note that if cookies from other Web Sites do work, you might have to change your local security settings.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Pablo Software Solutions Forum Index -> Quick 'n Easy Web Server All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


SwiftBlue Theme created by BitByBit
Powered by phpBB © 2001, 2002 phpBB Group