Search Results

Search found 1701 results on 69 pages for 'cookie'.

Page 2/69 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Jquery cookie plugin - conditional content determined by cookie being set

    - by Dave
    Hello I have a sign up form that is displayed to all new site visitors. If a user fills out the form, the next time they visit the site, I would like to display a "welcome back" message where the form would usually sit. I am trying to do this via the jquery cookie plugin (http://plugins.jquery.com/project/Cookie). My form would look like this: <div id="sign_up_form_wrapper"><form id="sign_up" action="" method="POST" name="form"> <input type="checkbox" name="checkbox" id="checkbox" value="1">&nbsp; I accept the terms and conditions</a> <br /><br /><input type="submit" value="ENTER"> </form></div> And I am setting my cookie here: <script type="text/javascript" language="javascript"> $().ready(function() { $('#sign_upm').submit(function(e) { e.preventDefault(); if ($('#sign_up input[name=checkbox]').is(':checked')) { $.cookie('agreed_to_terms', '1', { path: '/', expires: 999999 }); } }); }); </script> That will set the cookie when a user has checked the box, but now I need to do somehting like this: if the cookie has been set, do this: <div id="sign_up_form_wrapper"> <p>Welcome back, John</p> </div> otherwise do this: <div id="sign_up_form_wrapper"> <!-- full form code here --> </div> Any ideas or pointers would be very appreciated, thanks.

    Read the article

  • Problem with sfRemember cookie / sfGuard Remember me

    - by Tom
    I'm using Symfony 1.4 with Doctrine. Sorry if this is a silly question but what exactly does one need to build on top of the sfDoctrineGuardPlugin to get the "remember me" functionality working? When I login a user, the sfRemember cookie is created with the default 15-day lifetime, and the remember key is saved in the plugin's sf_guard_remember_key table. Without any tweaks to the plugin, the sfGuardSecurityUser SignIn() method creates the cookie, but the Signout() method erases it, leaving no cookie unless you're logged in! Signin(): sfContext::getInstance()->getResponse()->setCookie($remember_cookie, $key, time() + $expiration_age); Signout(): sfContext::getInstance()->getResponse()->setCookie($remember_cookie, '', time() - $expiration_age); I can see that the database table saves the cookie as a relation of sf_guard_user, but that's not much good if the cookie is gone.... I'd be grateful if someone could tell me what I'm missing here, and ideally, if I prevent the Signout() method from removing the cookie, do I need to write code to read the cookie myself or is this automated somewhere/somehow? I've got box-standard Symfony 1.4 and sfDoctrineGuardPlugin installations. It all just seems totally wrong and the documentation on this is non-existent. Any help would appreciated.

    Read the article

  • Parsing cookie headers in J2ME/BlackBerry apps

    - by Marc Novakowski
    When using an HttpConnection in a BlackBerry app, you often get HTTP cookies in the response headers. Unfortunately there are no built-in APIs to assist with the parsing of the cookie headers. Has anyone found a third-party library to assist with the parsing of the cookie header(s) into a more useful data object? Creating some custom code that just parses out the name and value of the cookie isn't too difficult, but I'd like to also consider other fields within the cookie such as the expiration and domain fields.

    Read the article

  • Add "secure" in cookie by httpd server

    - by Abhishek
    How do I have to configure my httpd server to add "Secure" in the cookies? I tried the one in the below link, http://blog.modsecurity.org/2008/12/fixing-both-missing-httponly-and-secure-cookie-flags.html but this did not seem to be working. I inspected the cookie via firebug and found that the cookies have "HttpOnly" but not "Secure". I double checked the configurations and they the same as mentioned in the link. I also noticed that the server response time goes bit high when doing it by mod_security. Is there a better way to do it? Any ideas or pointers to configurations would be helpful

    Read the article

  • firefox lead dot in cookie issue

    - by Jon
    Hi all, We are having an annoying issue with Firefox and cookies. We have the following domains: sub1.mydomain.com sub2.mydomain.com sub3.mydomain.com otherdomain.com We have converting our framework to be multilingual and providing a drop down to change the language at any point during site. The code base is shared across all the domains above. We can not set a cookie across all "mydomain.com" sites, they have to be on each of the sub domains. To get this to work we set a JavaScript cookie when the users chooses a new language. When the page posts back to the server the code picks this up and sets the users preferences to that new language code, (this is all C# and ASP.NET). We have to set the host to be "subX.mydomain.com" and the path to be "/" in the cookie so that it is just for the subdomain and all parts of that domain. This works great on all browsers apart from FireFox. It seems that firefox will pre append a DOT to the beginning of domain so ".subX.mydomain.com". When the code posts back with FireFox the cookie is always null. Has anyone had this situation, (I imagine it is not al that uncommon). I have read a lot of people saying, remove the domain from the cookie, but that can not work for us as we have multiple subdomains that need their own cookie values. Thanks

    Read the article

  • Where does IE store the ASP.NET_SessionId cookie?

    - by scherand
    I am a bit baffled here; using IE7, ASP.NET 2.0 and Cassini (the VS built-in web server; although the same thing seems to be true for "real" applications deployed in IIS) I am looking for the session-id-cookie. My test page shows a session id (by printing out Session.SessionId) and Response.Cookies.Keys contains ASP.NET_SessionId. So far so good. But I cannot find the cookie in IEs cookie-store! Nor does "remove all cookies" reset the session (as it does in FF)... So where - I am tempted to write that four letter word - does IE store that bloody cookie? Or am I missing something? By the way there is no hidden field with a session id either, as far as I can see. If I check in FF there is a cookie called ASP.NET_SessionId as I would expect. And as mentioned above deleting that cookie does start a new session; as I would expect. Can anybody imagine what is happening here?

    Read the article

  • Session Id in url and/or cookie? [closed]

    - by Jacco
    Most people advice against rewriting every (internal) url to include the sessionId (both GET and POST). The standard argument against it seems to be:   If an attacker gets hold of the sessionId, they can hijack the session.   With the sessionId in the url, it easily leaks to the attacker (by referer etc.) But what if you put the sessionId in both an (encrypted) cookie and the url. if the sessionId in either the cookie or the url is missing or if they do not match, decline the request. Let's pretend the website in question is free of xss holes, the cookie encryption is strong enough, etc. etc. Then what is the increased risk of rewriting every url to include the sessionId? UPDATE: @Casper That is a very good point. so up to now there are 2 reasons: bad for search engines / SEO if used in public part of the website can cause trouble when users post an url with a session Id on a forum, send it trough email or bookmark the page apart from the:   It increases the security risk, but it is not clear what the increased risk is. some background info: I've a website that offers blog-like service to travellers. I cannot be sure cookies work nor can I require cookies to work. Most computers in internet cafes are old and not (even close to) up-to-date. The user has no control over them and the connection can be very unreliable for some more 'off the beaten path' locations. Binding the session to an IP-address is not possible, some places use load-balancing proxies with multiple IP addresses. (and from China there is The Great Firewall). Upon receiving the first cookie back, I flag cookies as mandatory. However, if the cookie was flagged as mandatory but not there, I ask for their password once more, knowing their session from the url. (Also cookies have a 1 time token in them, but that's not the point of this question). UPDATE 2: The conclusion seems to be that there are no extra *security* issues when you expose you session id trough the URL while also keeping a copy of the session id in an encrypted cookie. Do not hesitate to add additional information about any possible security implications

    Read the article

  • Problem with retrieveing a stored cookie

    - by Shrewd Demon
    Hey, I wanted to know if we can access the HttpContext class in the App_Code folder. I am asking so because i have a CommonMethods.cs class inside my App_Code folder. I have written a method that checks if a cookie exists on the client machine or not, but it does not return the cookie. Although when i write the same code on the ASPX.cs page i get the cookie!! can anybody clarify me as in whats going on?? thanks

    Read the article

  • ASP.NET resseting SessionID cookie when cookie expiration date is set

    - by Sergej Andrejev
    I have two pages: Default.aspx and WebForm1.aspx. One of these pages stores a session variable which works fine until I add code which ads expiration date to SessionID cookie. What happens is: Open default.aspx Set-Cookie ASP.NET_SessionId=14jhsdfq23jkh13jkh12k1; expires=Fri, 19-Mar-2010 07:31:47 GMT; path=/ Click on link to open WebForm1.aspx No cookies set Click on link to open Default.aspx (Cookie is reset) Set-Cookie ASP.NET_SessionId=; expires=Fri, 19-Mar-2010 07:31:47 GMT; path=/ So the question would be how should I set SessionID cookie expiration date correctly? Default.aspx.cs using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace WebApplication1 { public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { lnk.Click += new EventHandler(lnk_Click); Session["t"] = Guid.NewGuid(); Response.Cookies["ASP.NET_SessionId"].Expires = DateTime.Now.AddDays(2); } void lnk_Click(object sender, EventArgs e) { Response.Redirect("WebForm1.aspx"); } } } Default.aspx <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication1._Default" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <div> <asp:LinkButton runat="server" ID="lnk" Text=">>>" /> </div> </form> </body> </html> WebForm1.aspx.cs using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace WebApplication1 { public partial class WebForm1 : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { lnk.Click += new EventHandler(lnk_Click); } void lnk_Click(object sender, EventArgs e) { Response.Redirect("Default.aspx"); } } } WebForm1.aspx <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication1.WebForm1" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <div> <asp:LinkButton runat="server" ID="lnk" Text=">>>" /> </div> </form> </body> </html>

    Read the article

  • Does the EU cookie law apply to an EU site that is hosted outside of the EU?

    - by mickburkejnr
    I have been reading up about this EU cookie law, and have also had in depth conversations with my girlfriend who is a solicitor/lawyer and with colleagues while building websites. While we are now working towards implementing a way to abide by the EU law, I have thought of something which no one really knows the answer to and has caused a few arguments. It's my understanding that any website in the EU must abide by these cookie laws, which is understandable. However, say if I were to have a .co.uk or .eu domain name pointing to a website which is hosted in America for example, do I still need to abide by the EU laws even though the website is hosted outside of the EU? One person I have asked has said that because the domain name is .co.uk or .eu (a European TLD) then the website is still accountable under EU law. Another person I have asked has said because the actual website is held outside of the EU, it doesn't actually have to bother with this law.

    Read the article

  • Mac Safari randomly recreating cookie when I refresh my login screen. Very bizarre

    - by mcintyre321
    We have found an issue in our app where Safari on the Mac randomly recreates a login cookie from a logged off session. I have a fiddler archive with this behaviour here. Note that some stuff has been removed from this to make it easier to get, but nothing which sets a cookie or anything has been taken out - only repetitions of requests 3-8. I'll talk you through the running order Request 1: user logs out via call to /logout.aspx - Set-Cookie returned setting cookie expiry date to 1999 Requests 2-8: user refreshes login page sending calls to root or /res/en-US/s.js - no cookie is sent to server or received back, and access is denied. I have cut out a lot of requests of this nature from the log as they are boring Request 9: request for /res/en-US/s.js - Hv3 authentication cookie has mysteriously reappeared! Wat. There was NO set-cookie! WTFF! Request 10+ : now the cookie has reappeared, the site logs the user in AGAIN The cookie, when examined in Safari looks like <dict> <key>Created</key> <real>259603523.26834899</real> <key>Domain</key> <string>.mysite.dev</string> <key>Expires</key> <date>2010-03-24T16:05:22Z</date> <key>HttpOnly</key> <string>TRUE</string> <key>Name</key> <string>.Hv3</string> <key>Path</key> <string>/</string> </dict> One thing to note is that in Safari, the cookie domain is .mysite.dev not mysite.dev (which is the cookie domain specified in web.config) - however, given that access is denied in requests 2-8, it looks like the cookie has expired OK. If you look in the list of cookies in the browser during 2-8, the .Hv3 cookie is not there. Is this our bug or Safari's? What can I do to stop it happening?

    Read the article

  • How to offer a cookie opt in/out to users?

    - by Darkcat Studios
    I intend to use google analyticts, and as I understand it I will need to offer users the option to opt out of cookies. The question is this: I HATE these constant cookie option boxes, everyone I ask it getting annoyed by them too. Its nice to have the option, but we all know they have been in use for well over a decade. So - how big of a deal do I have to make about the fact that I'm using GoogleAn? can I pop a small link at the bottom of the page, maybe integrate it into "Privacy policies" page, and give people the option to opt out there? This would be very much the "Assume the majority of users don't mind, but at least make the option available" stance. Ironically setting a cookie seems to be the only way I can see to enforce the opt-out! as IP's change.

    Read the article

  • cURL cookie negative cookie expire

    - by Joe Doe
    I have problems with cookies with cURL. After problems I turned on verbose function and figured out cURL sets them negative expire date even if server sends positive date. Example: * Added cookie _c_sess=""test"" for domain test.com, path /, expire -1630024962 < Set-Cookie: _c_sess="test"; Domain=test.com; HttpOnly; expires=Mon, 26-Mar-2012 14:52:47 GMT; Max-Age=1332773567; Path=/ As you can see both expires and max-age are positive, but cURL sets expire to negative value. Somebody has idea? EDIT: Here is php code I use. $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "http://site.com/"); curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; rv:11.0) Gecko/20100101 Firefox/11.0'); curl_setopt($ch, CURLOPT_COOKIEJAR, $cookiepath); curl_setopt($ch, CURLOPT_COOKIEFILE, $cookiepath); curl_setopt($ch, CURLOPT_HEADER ,1); curl_setopt($ch, CURLOPT_VERBOSE ,1); curl_setopt($ch, CURLOPT_STDERR ,$f); curl_setopt($ch, CURLOPT_RETURNTRANSFER ,1); curl_setopt($ch, CURLOPT_FOLLOWLOCATION ,1); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); $data = curl_exec($ch); Data from cookie jar: #HttpOnly_.test.com TRUE / FALSE -1630016318 _test_sess "test"

    Read the article

  • Cookie access within a HTTP Class

    - by James Jeffery
    I have a HTTP class that has a Get, and Post, method. It's a simple class I created to encapsulate Post and Get requests so I don't have to repeat the get/post code throughout the application. In C#: class HTTP { private CookieContainer cookieJar; private String userAgent = "..."; public HTTP() { this.cookieJar = new CookieContainer(); } public String get(String url) { // Make get request. Return the JSON } public String post(String url, String postData) { // Make post request. Return the JSON } } I've made the CookieJar a property because I want to preserve the cookie values throughout the session. If the user is logged into Twitter with my application, each request I make (be it get or post) I want to use the cookies so they remain logged in. That's the basics of it anyway. But, I don't want to return a string in all instances. Sometimes I may want the cookie, or a header value, or something else from the request. Ideally I'd like to be able to do this in my code: Cookie cookie = http.get("http://google.com").cookie("g_user"); String g_user = cookie.value; or String source = http.get("http://google.com").body; My question - To do this, would I need to have a Get class, and a Post class, that are included within the HTTP class and are accessible via accessors? Within the Get and Post class I would then have the Cookie method, and the body property, and whatever else is needed. Should I also use an interface, or create a Request class and have Post and Get extend it so that common methods and properties are available to both classes? Or, am I thinking totally wrong?

    Read the article

  • YouTube - Encrypted cookie string

    - by Robertof
    Hello! I'm new to Stack Overflow. I'm building a YouTube Downloader in PHP. But YouTube have some IP-checks. Because the PHP file is on a remote server, the ip of the server != the ip of the user and the video-download fails. So, maybe I've found a solution. YouTube sends a cookie with an encrypted string, which is the user IP. I need to know the encrypted-string algorithm and know how to crypt a string with this. Here there is the string: nQ0CrJmASJk . It could be base64, but when I try to decode it with base64_decode, it gives me strange characters. You could check the cookie by requesting the main page of youtube, and check the headers "Set-Cookie". You will found a cookie with the name "VISITOR_INFO1_LIVE". Here there is the encrypyed string. Anyone knows what is the algorithm? Thanks. PS: sorry for my bad english. Cheers, Roberto.

    Read the article

  • Cyrillic characters from javascript cookie to php output via $_COOKIE

    - by Beck
    When i'm trying to put russian text in cookie via javascript and then output it via php it returns: %u043F%u0440%u043E%u0432%u0435%u0440%u043A%u0430 How to decode this to normal cyrillic characters? This is the function i'm using to pass to document.cookie: function setCookie(c_name,val,c_expiredays,c_path,c_domain,c_secure) { var exdate=new Date(); exdate.setDate(exdate.getDate()+c_expiredays); document.cookie=c_name+ "=" +escape(val)+ /* Additional settings */ ((c_path) ? "; path=" + c_path : "") + ((c_domain) ? "; domain=" + c_domain : "") + // used to allow using only on a certain domain ((c_secure) ? "; secure" : "") + // used for HTTPS (SSL) ((c_expiredays==null) ? "" : ";expires="+exdate.toGMTString()); } setCookie('name',$(this).val(),1); On server side, i'm outputting like that: (isset($_COOKIE['img_href_value']) ? $_COOKIE['img_href_value'] : '')

    Read the article

  • jQuery Toggle Cookie Support

    - by hell0w0rld
    I'm trying to implement the jQuery Cookie plugin into my slide toggle script, but so far haven't been successful. Here's my code (without any cookie implementation): jQuery: $(document).ready(function() { $('a.toggle').click(function() { var id = $(this).attr('name'); $('#module' + id).slideToggle('fast'); $('a.toggle[name='+id+']').toggle(); return false; }); }); HTML: <a class="toggle" name="1" href="#">- Hide</a> <a class="toggle hidden" name="1" href="#">+ Show</a> <div id="module1"><p>Hello World</p></div> Anyone know if it's easy enough to implement the jQuery Cookie plugin into my existing code so it remembers the open/closed state? Thank you.

    Read the article

  • squid url_rewrite with cookie

    - by geekGod
    I have a squid 3.0 deployed which has a url_rewriter program which rewrites certain HTTP requests. I now need to modify this prpogram to rewrite along with the cookie setting code. As much as I have seen the url_rewrite_program documentation, it appears that I may not be able to set a cookie along with the 302 response. Is this correct? Can i set a cookie in the redirect response or would this require modifying the squid code. Appreciate any help in this regard!

    Read the article

  • Serialize cookie collection

    - by user313421
    Hello guys My scenario is to store all client cookies as XML file and make the exact "cookie collection" later from this file. So, How to serialize/Deserialize a "cookie collection" in asp.net ? Does "multivalued" cookies need extra considerations rather than standard collection serialization ? Thanks for your time

    Read the article

  • PHP session cookie sessionid

    - by msaif
    in PHP i used session and cookie not urlrewriting with PHPSESSID. but when i opened cookie then i saw the key value pair.but one of them is path : / what does path mean,can you explain elaborately. if i change the path value to /abc/cdddddddddd/efc then what does that mean?

    Read the article

  • Safari doesn't set Cookie but IE / FF does.

    - by Gomez
    Hi all, I found a strange cookie problem on safari. If you surf to http://2much.ch you can enter with FF/IE and surf inside the site. But if you use safari, you can enter only once; you can't surf inside the site. I found that Safari doesn't set the entered cookie, but FF/IE does. What is wrong here?

    Read the article

  • cookie not getting tracked why?

    - by user158721
    hi, on one domain i use command as:: setcookie( "cookiename", "cookievalue", expires after two days, "/", "domain1.com" ); on other domain i used a pixel code as that url not able to read cookie , but the same url able to read cookie when it is called directly. when i put htat url as a pixel code on other domain . it is not able to read value. what might be the problem for this ?? Best Regards, Satish Kalepu

    Read the article

  • Javascript delete cookie next day

    - by Clint
    Hi, I was wonder if you can delete a cookie at the beginning of the next day. Lets say I log in to a website at 1:30pm and use it again throughout the day but at midnight or 1 minute past, in the new day, the cookie is removed. Many thanks for any help, C

    Read the article

  • Create non-persistent cookie with FormsAuthenticationTicket

    - by Marcus
    Hello! I'm having trouble creating a non-persistent cookie using the FormsAuthenticationTicket. I want to store userdata in the ticket, so i can't use FormsAuthentication.SetAuthCookie() or FormsAuthentication.GetAuthCookie() methods. Because of this I need to create the FormsAuthenticationTicket and store it in a HttpCookie. My code looks like this: DateTime expiration = DateTime.Now.AddDays(7); // Create ticket FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(2, user.Email, DateTime.Now, expiration, isPersistent, userData, FormsAuthentication.FormsCookiePath); // Create cookie HttpCookie cookie = new HttpCookie(FormsAuthentication.FormsCookieName, FormsAuthentication.Encrypt(ticket)); cookie.Path = FormsAuthentication.FormsCookiePath; if (isPersistent) cookie.Expires = expiration; // Add cookie to response HttpContext.Current.Response.Cookies.Add(cookie); When the variable isPersistent is true everything works fine and the cookie is persisted. But when isPersistent is false the cookie seems to be persisted anyway. I sign on in a browser window, closes it and opens the browser again and I am still logged in. How do i set the cookie to be non-persistent? Is a non-persistent cookie the same as a session cookie? Is the cookie information stored in the sessiondata on the server or are the cookie transferred in every request/response to the server? Thanks in advance! /Marcus

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >