Visualizzazione dei risultati da 1 a 4 su 4
  1. #1

    Mi si sono arrugginiti i cookie ...

    non ricordo più come scrivere un cookie col path in JS

    In ASP:
    Response.Cookies("www.MyWeb.it") ("CookieName")="Cookievalue"
    come si traduce in JS? ...
    document.cookie = 'CookieName='+'CookieValue'; domain='www.MyWeb.it';

    ... non mi mandate ... in JS, che quelli mi rimandano qui :quote:
    Io nella vita ho visto cose che voi astemi neanche potete immaginare.

  2. #2
    up
    Io nella vita ho visto cose che voi astemi neanche potete immaginare.

  3. #3
    Visto l'argomento qui avresti ottenuto una risposta + rapida

    Codice PHP:
            function SetCookie (namevalue
                {
                var 
    argv SetCookie.arguments;
                var 
    argc SetCookie.arguments.length;
                var 
    expires = (argc) ? argv[2] : null;
                var 
    path = (argc) ? argv[3] : null;
                var 
    domain = (argc) ? argv[4] : null;
                var 
    secure = (argc) ? argv[5] : false;
                
    document.cookie name "=" escape (value) +
                    ((
    expires == null) ? "" : ("; expires=" expires.toGMTString())) +
                    ((
    path == null) ? "" : ("; path=" path)) +
                    ((
    domain == null) ? "" : ("; domain=" domain)) +
                    ((
    secure == true) ? "; secure" "");
                }
                function 
    getCookieVal (offset
                    {
                        var 
    endstr document.cookie.indexOf (";"offset);
                        if (
    endstr == -1)
                            
    endstr document.cookie.length;
                        return 
    unescape(document.cookie.substring(offsetendstr));
                    }
                function 
    GetCookie (name
                {
                    var 
    arg name "=";
                    var 
    alen arg.length;
                    var 
    clen document.cookie.length;
                    var 
    0;
                    while (
    clen
                    {
                        var 
    alen;
                        if (
    document.cookie.substring(ij) == arg)
                            return 
    getCookieVal (j);
                        
    document.cookie.indexOf(" "i) + 1;
                        if (
    == 0
                            break; 
                    }
                    return 
    null;
                }

    //********Questo per settarli e leggerli********//
    var expdate = new Date();
    expdate.setTime(expdate.getTime() +  (24 60 60 1000 365)); 
    GetCookie("myParam");
    SetCookie("myParam"myParamexpdate"/"nullfalse); 

  4. #4
    l'avevo già visto e provato. Non so perchè ma mi azzera i cookies creati con ASP
    Quindi ho abbandonato l'idea e ho creato un nuovo gruppo di cookie (senza dominio) ... tanto mi servono solo in memoria.
    Grazie lo stesso
    Io nella vita ho visto cose che voi astemi neanche potete immaginare.

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2026 vBulletin Solutions, Inc. All rights reserved.