Click to See Complete Forum and Search --> : reading and writing a cookie into the ram?


pelegk1
10-16-2003, 05:11 AM
i want to write a cookie only to the ram memory how do i do it?

requestcode
10-16-2003, 06:51 AM
I don't believe that you can write cookies to RAM only, but you could use Session-only cookies. Here is a link to a tutorial on the subject.
http://www.javascriptkit.com/javatutors/cookie.shtml

Session-Only cookies will only last as long as the browser is open. Once it is closed the cookies are gone.

slam
10-16-2003, 08:21 AM
seems nice, but ...
cookies must be enabled in the browser and lots of people just don't want that !
they are not supposed to know (or trust) that the cookie will be removed when the session closes.

gr

pelegk1
10-19-2003, 01:35 AM
but some 1 told me before that the session cookie isnt really saved in memory but rather saved to the HD,
but the expire time isnt given
so when the browser is closed or opened the cookie is being deleted!
do u know anything about it?

AdamGundry
10-19-2003, 02:12 AM
You cannot force a cookie to be kept in RAM. You cannot force anything to be kept in RAM - most modern operating systems use a swap file to store on the hard disk data that is not in immediate use. Otherwise you could only work with documents up to your RAM limit - with paging, it just slows down.

I believe that session cookies are stored on the harddrive normally, then deleted as you said. Slam, decent browsers allow users to block all cookies except session cookies, or limit expiry times. Users can trust they will be removed if they trust their browser.

Adam

pelegk1
10-19-2003, 03:10 AM
....decent browsers allow users to block all cookies except session cookies.....


well that is not correct!
u can block session cookies too!!!!
on my wb site i check that and if the user's session cookie is blocked i am sending him to an error page that explain him why

AdamGundry
10-19-2003, 04:09 AM
Sorry, what I meant was that the user can choose to block all cookies except session cookies if they wish, or can block all/none as usual.

Adam

pelegk1
10-19-2003, 05:16 AM
but u can block session cookies withought any connection
to the regular cookies

slam
10-19-2003, 06:17 AM
Adam,

usuallly users lock cookies except for sites they trust such as banking sites (https://) I have personally never seen the option to allow session cookies or not.
I can check if cookies are blocked but can not force visitors to change their settings which means that most users will turn away from my site.
Unless there is a way to change their settings to "allow session cookies" without their being aware of it.

thank you for your reactions.

pelegk1
10-19-2003, 06:35 AM
there is no way to force the user
beause if there was -> it eans he has very dangerous security problem which means u can f*** with his pc and do with it what ever u want