Daan Poron Daan Poron - 5 months ago 57
HTML Question

Session only cookies with Javascript

I was wondering if it's possible to create session only cookies with Javascript. When the browser is closed the cookies should be removed.

I can't use anything on the server as the website is HTML only ... so no server side script is used.

I read something about this here:
but i can't find any more information about this ... so i was wondering if this method is reliable.


Yes, that is correct.

Not putting an expires part in will create a session cookie, whether it is created in JavaScript or on the server.

See http://stackoverflow.com/a/532660/1901857