×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Regular Contributor
    Join Date
    Jun 2010
    Posts
    161

    Not really WRT: S60 Browser offline and with cookies

    Hi,

    it's not really WRT but I haven't found the right category. I came to the same conclusion as the "here and now"-team: why starting a programm which will for sure link to a webpage if the stuff the programm does can be done by the browser as well.

    So I try to save some userdata, in this case some urls within the "programm". The only way to do that is (correct me if I am wrong) with cookies. But the site seems to only save the cookies if the .htm is on a webserver, not if the file is locally stored ( file:///E:/testprog/test.htm ).

    Is this some problem I could avoid? Or a browser issue (it's working with Firefox...).

    I am testin with a 5800XM.

    THX for help!

    EDIT: I am adding the cookie with the following code:
    function readCookie(name) {
    var nameEQ = name + "=";
    var ca = document.cookie.split(';');
    for(var i=0;i < ca.length;i++) {
    var c = ca[i];
    while (c.charAt(0)==' ') c = c.substring(1,c.length);
    if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
    }
    return null;
    }
    Last edited by lorion84; 2010-06-17 at 22:09. Reason: could help to know

  2. #2
    Nokia Developer Champion
    Join Date
    Nov 2007
    Location
    Rome, Italy
    Posts
    2,405

    Re: Not really WRT: S60 Browser offline and with cookies

    Hi lorion84,

    welcome to Forum Nokia Discussion Boards!

    The code you've posted seems to be related to cookies' reading, not writing: have you maybe posted the wrong code snippet?

    Pit

  3. #3
    Regular Contributor
    Join Date
    Jun 2010
    Posts
    161

    Re: Not really WRT: S60 Browser offline and with cookies

    Stupid me

    function createCookie(name,value,days) {
    if (days) {
    var date = new Date();
    date.setTime(date.getTime()+(days*24*60*60*1000));
    var expires = "; expires="+date.toGMTString();
    }
    else var expires = "";
    document.cookie = name+"="+value+expires+"; path=/";
    }

  4. #4
    Nokia Developer Champion
    Join Date
    Nov 2007
    Location
    Rome, Italy
    Posts
    2,405

    Re: Not really WRT: S60 Browser offline and with cookies

    Thanks for the snippet.

    Just a question: if you want to display local HTML pages, why wouldn't you switch to a WRT widget?

    Pit

  5. #5
    Regular Contributor
    Join Date
    Jun 2010
    Posts
    161

    Re: Not really WRT: S60 Browser offline and with cookies

    Easy: the site should act as startpage forthe browser. So a wrt wont do the job.

    The possibilitie to have the page offline would be nice2have.

    Any suggestions?

  6. #6
    Nokia Developer Champion
    Join Date
    Nov 2007
    Location
    Rome, Italy
    Posts
    2,405

    Re: Not really WRT: S60 Browser offline and with cookies

    I have not direct experience with cookies and local HTML pages, anyway I'll give it a try and let you know.

    Pit

  7. #7
    Regular Contributor
    Join Date
    Jun 2010
    Posts
    161

    Re: Not really WRT: S60 Browser offline and with cookies

    Have you found something out?

    Bye.

Similar Threads

  1. cookies in WRT
    By wenzhengchen in forum Symbian
    Replies: 1
    Last Post: 2010-04-29, 12:45
  2. Cookies in WRT 1.1
    By rafiton in forum Symbian
    Replies: 1
    Last Post: 2009-07-16, 21:36
  3. cookies in browser and session management in j2me
    By qasitouch in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2007-05-08, 05:30

Posting Permissions

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