Solved

asp and cookies

Posted on 2000-03-13
10
341 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

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…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

627 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