SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Guru momos's Avatar
    Join Date
    Apr 2004
    Location
    Belgium
    Posts
    919
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    sessionStorage vs cookies

    Am I correct in thinking that sessionStorage (when all browsers support it) makes cookies in ecmascript useless? Or does anyone know a use case in which you should still use cookies?

  2. #2
    secure webapps for all Aleksejs's Avatar
    Join Date
    Apr 2008
    Location
    Riga, Latvia
    Posts
    755
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think cookies would still be used to identify session on server side.
    Otherwise you'd have to extract SessionID from sessionStorage, then somehow send it (GET/POST/HEADER) each time user accesses resource where session identification is required.

  3. #3
    SitePoint Guru momos's Avatar
    Join Date
    Apr 2004
    Location
    Belgium
    Posts
    919
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Isn't it so that sessionStorage does not send data to the server. I thought you had to write your own script to send info to the server...

  4. #4
    secure webapps for all Aleksejs's Avatar
    Join Date
    Apr 2008
    Location
    Riga, Latvia
    Posts
    755
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes - that is the point.
    But how will server know, which user/session to serve?

  5. #5
    SitePoint Guru momos's Avatar
    Join Date
    Apr 2004
    Location
    Belgium
    Posts
    919
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    an ajax call doesn't use session cookies

  6. #6
    secure webapps for all Aleksejs's Avatar
    Join Date
    Apr 2008
    Location
    Riga, Latvia
    Posts
    755
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, you could do without cookies, but is it worth it? You'd have to reimplement whole session management mechanism (setting/transmitting/destroying session token) on client side.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •