Solved

asp and cookies

Posted on 2000-03-13
10
334 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

863 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now