Solved

asp and cookies

Posted on 2000-03-13
10
337 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
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

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…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

770 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