Results 1 to 8 of 8
  1. #1
    Join Date
    Mar 2004
    Posts
    1,303

    Lightbulb cookie or session?

    Hi,

    I am developing a bilangual website where users have choice to select some pre-determined languages. Right now, I am using, but I am not sure if this is a good idea. If user does not want to use cookie, then he/she won't be able to select his desired language but has to use a default language set up by me.

    So, is session a better solution?

    Thanks

  2. #2
    Join Date
    Aug 2002
    Location
    Superior, CO, USA
    Posts
    635
    I agree that cookies are probably the best way to remember the preference of the user. However, most browsers send the language that the user has selected. For example, my browser sends:

    Accept-Language: en-us,en;q=0.5

    Based on this you can make an educated guess as to what language to serve to the client. It may not be perfect but it might be better than just sending them the language that you choose.

  3. #3
    Join Date
    Mar 2004
    Posts
    1,303
    hi stdunbar,

    That is a good idea. However, my website uses unicode(utf-8) as charset. Therefore, any setting on the user's browser encoding will be change to utf-8 once they visit my website.

    I am still very curious how to determine what language a user has selected

    Thanks stdunbar!

  4. #4
    Join Date
    Jul 2003
    Location
    Vancouver, BC, Canada
    Posts
    88
    I don't know, but cookies didn't work really well with IE when I tested them - it seemed like IE didn't accept my site's cookies at all. Although, they worked fine in Mozilla and Opera.

  5. #5
    Join Date
    Aug 2002
    Location
    Superior, CO, USA
    Posts
    635
    But UTF-8 is a character set, not a locale. My browser also sends:

    Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7

    These are different things. I use English as my language and that can be represented in UTF-8 just fine. But so can French, Spanish and so on. Indeed, if you're using UTF-8 you'll be able to represent alot of languages.


    Originally posted by orbitz
    hi stdunbar,

    That is a good idea. However, my website uses unicode(utf-8) as charset. Therefore, any setting on the user's browser encoding will be change to utf-8 once they visit my website.

    I am still very curious how to determine what language a user has selected

    Thanks stdunbar!

  6. #6
    Join Date
    Mar 2004
    Posts
    407
    Do you mean an ASP/.NET Session? If so then session follows the same rules as a cookie. If the user does not allow cookies, the session will not work either. I personally do not like sessions because they keep info on the persons desktop and on the server which takes up server resources.

    However, the session is more secured then the cookie, but in your case it does not matter.
    Alvin

  7. #7
    Join Date
    Mar 2004
    Posts
    1,303
    stdunbar

    ok, I understand now.

  8. #8
    Join Date
    Mar 2004
    Posts
    1,303
    I don't know, but cookies didn't work really well with IE when I tested them - it seemed like IE didn't accept my site's cookies at all. Although, they worked fine in Mozilla and Opera.
    I have no problem with the cookies on these browsers.


    Alvinks,

    I am using PHP

Posting Permissions

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