Can I use a javascript function that converts string into byte?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Shadab

    Can I use a javascript function that converts string into byte?

    Problem: I want to store data from a form into a cookie but the cookie
    size is limited to 5kb. Eventually if the saved data crosses the limit
    5 it does not get saved anymore. Is there any possibility to reduce
    the size of the string so that I can save some more datas in a cookie?

    What javascript function on clientside can I use that converts the
    string into byte? Or, Is there a possibility to increase the cookie
    size & how?

    Thanks in anticipation.
  • Thomas 'PointedEars' Lahn

    #2
    Re: Can I use a javascript function that converts string into byte?

    Shadab wrote:
    [color=blue]
    > Problem: I want to store data from a form into a cookie but the cookie
    > size is limited to 5kb. Eventually if the saved data crosses the limit
    > 5 it does not get saved anymore. Is there any possibility to reduce
    > the size of the string so that I can save some more datas in a cookie?[/color]

    Depends.

    You could try apply a compression algorithm on the data
    before storing it and decompress it after retrieval.

    Could you show a short example of the data to be stored?
    [color=blue]
    > What javascript function on clientside can I use that converts the
    > string into byte?[/color]

    Since there is no `byte' type in JavaScript (it uses floating-point
    arithmetics only), there is no such function.
    [color=blue]
    > Or, Is there a possibility to increase the cookie size & how?[/color]

    No, and if you think it through you will agree that it is a Good Thing
    as it is.


    PointedEars

    Comment

    Working...