Solved

asp and cookies

Posted on 2000-03-13
10
338 Views
Last Modified: 2008-03-04
i saved a cookie :
Response.Cookies ("transp")("emp_id") = "999"
Response.Cookies ("transp").Expires = DATE + 365

when i tried to retrieve the information
in other page the cookie was empty
i tried to retrieve it by:

cookie_emp_id=request.cookies("transp")("emp_id")

response.write cookie_emp_id

what to do?
0
Comment
Question by:eladr
  • 3
  • 2
  • 2
  • +3
10 Comments
 
LVL 4

Expert Comment

by:jkunal
ID: 2612534
Response.Cookies("transp").Expires = Now + CDbl(365)
0
 
LVL 1

Author Comment

by:eladr
ID: 2612562
not working...
the cookie is "living" only in the same page.
the strangest thing is that was
working well yesterday
0
 
LVL 19

Expert Comment

by:daveamour
ID: 2612666
are dates not stored as milliseconds?

If so, adding 365 will be adding just under half a second to the expiry date.

could this be the problem?
0
Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

 
LVL 8

Expert Comment

by:xabi
ID: 2612726
daveamour:
no, this is how to create a cookie with 5 days expritarion:

Response.Cookies("mycookie").Expires
= date + (365*5)

xabi
0
 
LVL 8

Expert Comment

by:xabi
ID: 2612732
Try this:

Response.Cookies("transp").Path = "/"

xabi
0
 
LVL 1

Author Comment

by:eladr
ID: 2612812
it's strange...
i changed the name of the cookie and everything is good now.
is someone has an idea?
i dont want it to happened again with
my new name.

elad
0
 
LVL 10

Expert Comment

by:Yury_Delendik
ID: 2612850
Try it. And say what do you get?

<%
Response.Write Request.Cookies ("transp")
Response.Cookies ("transp").Expires = -1
%>
0
 
LVL 1

Author Comment

by:eladr
ID: 2612897
this is the error:
Cookies object error 'ASP 0200 : 80004005'

Out of Range 'Expires' attribute

/orange/sa.asp, line 3

The date given for 'Expires' precedes Jan 1, 1980 or excedes Jan 19, 2038, 3:14:07 GMT.
0
 
LVL 10

Expert Comment

by:Yury_Delendik
ID: 2612982
Sorry
<%
Response.Write Request.Cookies ("transp")
Response.Cookies ("transp").Expires = Now()
%>
and try your code
0
 
LVL 1

Accepted Solution

by:
cybotto earned 25 total points
ID: 2613171
I have the same problem with this cookies, there are working fine till something happens (maybe the limit of 30 cookies per Domain?). I realized in Netscape there is no problem to read cookies.  I'm sure i didn't make a mistake. Yes has something to do with the name or so, renaming helps.  I realized as well is only on my mashine where I developed my scripts, on other machines works fine.


0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question