Search Results

Search found 56333 results on 2254 pages for 'set cookie'.

Page 8/2254 | < Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >

  • How to create custom get and set methods for Linq2SQL object

    - by optician
    I have some objects which have been created automatically by linq2SQL. I would like to write some code which should be run whenever the properties on these objects are read or changed. Can I use typical get { //code } and set {//code } in my partial class file to add this functionality? Currently I get an error about this member already being defined. This all makes sense. Is it correct that I will have to create a method to function as the entry point for this functionality, as I cannot redefine the get and set methods for this property. I was hoping to just update the get and set, as this would mean I wouldn't have to change all the reference points in my app. But I think I may just have to update it everywhere.

    Read the article

  • Browser: Cookie lost on refresh

    - by Nirmal
    I am experiencing a strange behaviour of my application in Chrome browser (No problem with other browsers). When I refresh a page, the cookie is being sent properly, but intermittently the browser doesn't seem to pass the cookie on some refreshes. This is how I set my cookie: $identifier = / some weird string /; $key = md5(uniqid(rand(), true)); $timeout = number_format(time(), 0, '.', '') + 43200; setcookie('fboxauth', $identifier . ":" . $key, $timeout, "/", "fbox.mysite.com", 0); This is what I am using for page headers: header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 header("Expires: Thu, 25 Nov 1982 08:24:00 GMT"); // Date in the past Do you see any issue here that might affect the cookie handling? Thank you for any suggestion. EDIT-01: It seems that the cookie is not being sent with some requests. This happens intermittently and I am seeing this behaviour for ALL the browsers now. Has anyone come across such situation? Is there any situation where a cookie will not be sent with the request? Thanks again, for any guideline.

    Read the article

  • deleting cookie at the end of a process

    - by RyanP13
    Hi, I am using the following plug in for cookies in jQuery: https://code.google.com/p/cookies/ The issue i am having is not with the plugin but when and how to delete the cookie at the end of a quoting process. The site i am using this on is a six step online quote and buy process. There is Omniture event serialisation sitestat tracking applied to some of the pages. This event serialisation has to include the name of the event and a random number of which i create. I have a generic function for this which i call at the bottom of the page like so: serialEvent('event21:', 'payment'); Here is the function: function serialEvent(eventNumber, eventName) { var sessionID = jaaulde.utils.cookies.get('sessionID'); var remLength = 20 - eventName.length; var remSession = sessionID.substr(sessionID.length - remLength, remLength); var eventName = eventName + remSession; s.events = eventNumber + eventName; } I need to delete the cookie at the end of the process, the Thank you page but i also need the cookie 'sessionID' for the 'serialEvent' function. As the function is called at the bottom of the page should i just write the cookie delete after it? Is that robust enough? I need to be sure that the function has successfully been called before the cookie is deleted. The code for deleting the cookie is quite simple: jaaulde.utils.cookies.del('sessionID'); Thanks :)

    Read the article

  • Java: Set<E> collection, where items are identified by its class

    - by mschayna
    I need Set collection, where its items will be identified by items class. Something like ReferenceIdentityMap from Appache Collections, but on class scope i.e. two different instances of same class must be identified as same in this collection. You know, it is a violation of equals()/hashCode() identity principle but in occasional use it makes sense. I have done this in simple class backing with Map<Class<? extends E>, E>, but due to simplicity it doesn't implement Set<E>. There may be a more elegant solution, decorator of any Set<E> would be great. Is there any implementation of such collection there (Apache/Google/something/... Collections)?

    Read the article

  • Jetty 7 will not allow me to customize a session cookie path

    - by Bob Obringer
    Using Jetty 7.0.2, I am unable to set a custom session cookie path. I am hosting multiple sites on the same server using apache to proxy requests to the proper context. (replaced http as htp as stackoverflow thinks my multiple links might be spam) <VirtualHost *:80> ServerName context.domain.com ProxyRequests On ProxyPreserveHost Off <Proxy *:80> Order deny,allow Allow from 127.0.0.1 </Proxy> ProxyPass / htp://localhost:8080/context/ ProxyPassReverse / htp://localhost:8080/context/ <Location /> Order allow,deny Allow from all </Location> </VirtualHost> Jetty is running on the same server on port 8080 and my context is available @ /context The user accesses the application @ htp://context.domain.com but jetty is setting the path for the session cookie @ /context. This prevents the browser from accessing the cookie since the the actual path to the context is not being used. I need to override Jetty's default setting to set the cookie for the context, and set the path at the root ( / ). In my Jetty's webdefault.xml I have the following, which is partially working: <context-param> <param-name>org.eclipse.jetty.servlet.SessionCookie</param-name> <param-value>CustomCookieName</param-value> </context-param> <context-param> <param-name>org.eclipse.jetty.servlet.SessionPath</param-name> <param-value>/</param-value> </context-param> The cookie is properly set with a custom name, but it is NOT setting the SessionPath. No matter what I set the value to... it refuses to set a cookie at any path but /context. This has been driving me crazy so any help would be greatly appreciated.

    Read the article

  • Pass HTML form entries into a Javascript array to then be written to a client side cookie?

    - by Tom
    I'm building a bit of a test-case JS application, something very basic, but have run into some problems. I'm trying to use a HTML form for a user to enter a number, which is then written to a Javascript Array. The user then has the option to write that same array to a local (client side) cookie. (I understand the security implications of this - it's a test-case and not for commercial use.) However, I can't make the connection - how can I capture the HTML entry, press 'submit' which will send it to a JS array, where the user can then press a different 'submit' which will write the array to a text file? If anyone can help I'd appreciate it because it's been nearly 6 hours and it's not funny anymore.

    Read the article

  • Javascript Cookie problems IE

    - by blakey87
    Hi guys, been bagging my head over some Javascript, please help, I cant see why it simply wont find my cookie in IE 7 or 8 I am setting the cookie true through another event, but I just want to see IE pick up the cookie which I initially set. Works in firefox too, thanks in advance. var t=setTimeout("doAlert()",8000); var doAlertVar = true; document.cookie = "closed=0;expires=0;path="; function readCookie(name) { var nameEQ = name + "="; var ca = document.cookie; alert(ca); ca = ca.replace(/^\s*|\s*$/g,''); 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; } function doAlert(){ if(readCookie('closed')==1){ doAlertVar = false; } if(readCookie('closed')==0){ alert("unlicensed demo version\nbuy online at"); } t=setTimeout("doAlert()",5000); }

    Read the article

  • Looking at the C++ new[] cookie. How portable is this code?

    - by carleeto
    I came up with this as a quick solution to a debugging problem - I have the pointer variable and its type, I know it points to an array of objects allocated on the heap, but I don't know how many. So I wrote this function to look at the cookie that stores the number of bytes when memory is allocated on the heap. template< typename T > int num_allocated_items( T *p ) { return *((int*)p-4)/sizeof(T); } //test #include <iostream> int main( int argc, char *argv[] ) { using std::cout; using std::endl; typedef long double testtype; testtype *p = new testtype[ 45 ]; //prints 45 std::cout<<"num allocated = "<<num_allocated_items<testtype>(p)<<std::endl; delete[] p; return 0; } I'd like to know just how portable this code is.

    Read the article

  • Setting Session/Cookie via ajax request made on other website

    - by user596805
    Hi, That's my problem: I have an website, example.com, in which index.html file a introduced a <script src="website.net/js.js"></script> You can see, that this is on other web server. In the js.js I have some data that I want to send to php. For that, I am using Ajax. So, I made a request to "website.net/data.php" using method get. In data.php file everything is ok,I received the value, but I want to set a cookie which value is what I received through ajax. Here is the problem. The setcookie function says that the cookie was set, but when I check in the browser, there's no cookie! It works fine if the index.html file where I use <script src="website.net/js.js"></script> is hosted on the same domain where I am making the request. If it is on another domain, it doesn't work anymore. I have read something about Ajax cross site, but I don't want to send something back to example.com. All I want is to send some data from example.com to website.net and then setting a cookie based on that value. Thank you very much, and sorry for my English! Later edit: I am not used with this website. From the example.net I take a single value. On website.net I receive that value, I check if it's not already a cookie set, if it's not, I set it. On the same page, website.net, I use this cookie too.

    Read the article

  • PHP session_write_close() keeps sending a set-cookie header

    - by Chiraag Mundhe
    In my framework, I make a number of calls to session_write_close(). Let's assume that a session has been initiated with a user agent. The following code... foreach($i = 0; $i < 3; $i++) { session_start(); session_write_close(); } ...will send the following request header to the browser: Set-Cookie PHPSESSID=bv4d0n31vj2otb8mjtr59ln322; path=/ PHPSESSID=bv4d0n31vj2otb8mjtr59ln322; path=/ There should be no Set-Cookie header because, as I stipulated, the session cookie has already been created on the user's end. But every call to session_write_close() after the first one in the script above will result in PHP instructing the browser to set the current session again. This is not breaking my app or anything, but it is annoying. Does anyone have any insight into preventing PHP from re-setting the cookie with each subsequent call to session_write_close? EDIT The problem seems to be that with every subsequent call to session_start(), PHP re-sets the session cookie to its own SID and sends a Set-Cookie response header. But why??

    Read the article

  • C++: need indexed set

    - by user231536
    I need an indexed associative container that operates as follows: initially empty, size=0. when I add a new element to it, it places it at index [size], very similar to a vector's push_back. It increments the size and returns the index of the newly added element. if the element already exists, it returns the index where it occurs. Set seems the ideal data structure for this but I don't see any thing like getting an index from a find operation. Find on a set returns an iterator to the element. Will taking the difference with set.begin() be the correct thing to do in this situation?

    Read the article

  • Google Chrome forgetting registration cookie immediately

    - by Ryan Giglio
    I'm having trouble with cookies on my site's registration form. When a user creates an account, PHP sets one cookie with their user id, and one cookie with a hash containing their user agent and a few other things. Both of these cookies are set to expire in an hour. This is the code that sets the cookie after creating your account $registerHash = hash( "sha512", $_SERVER['HTTP_USER_AGENT'] . $_SERVER['HTTP_HOST'] . $_SERVER['DOCUMENT_ROOT'] ); setcookie("register_user_id", $newUserID, time() + 7200, "/"); setcookie("register_hash", $registerHash, time() + 7200, "/"); The next page is a confirmation page which sends an email and then optionally lets the user go on to fill out more account information. If the user goes on to fill out more, it uses the cookie to know what account to save it to. It works correctly in Firefox and IE, but in Chrome the cookie is forgotten as soon as you go to the next page. The cookie simply doesn't exist. You can see the problem here: http://crewinyourcode.com/register/paid/ If you use Chrome, you will get a registration timeout error as soon as you try to advance past the confirmation page. However on Firefox it works fine.

    Read the article

  • flex: cant edit item in Datagrid with override set data method

    - by Markus
    Hi everybody, I've a custom itemRenderer for my datagrid. To set the actual data I use the following method: override public function set data(side:Object):void{ ... } As soon as I use this function the cell doesn't show up any item Editor anymore. Why is that? When I remove this function the itemEditor is working but with the wrong initialization data... What's the proper way to handle this? Thanks, Markus

    Read the article

  • dynamically set the control template

    - by Saboor
    hi, i am using dictionaries in WPF. i have two bitmap image in it with name something like image1 and image2 now in forms, i like to set them to single image control depending on condition, some times image1 and sometimes image2. so how i set the source dynamically, in dictonary i have UriSource="/wpf1;component/images/infobarGreen.png" / UriSource="/wpf1;component/images/infobarRed.png" /

    Read the article

  • Java - Is Set.contains() broken on OpenJDK 6?

    - by Peter
    Hey, I've come across a really strange problem. I have written a simple Deck class which represents a standard 52 card deck of playing cards. The class has a method missingCards() which returns the set of all cards which have been drawn from the deck. If I try and compare two identical sets of missing cards using .equals() I'm told they are different, and if I check to see if a set contains an element that I know is there using .contains() I am returned false. Here is my test code: public void testMissingCards() { Deck deck = new Deck(true); Set<Card> drawnCards = new HashSet<Card>(); drawnCards.add(deck.draw()); drawnCards.add(deck.draw()); drawnCards.add(deck.draw()); Set<Card> missingCards = deck.missingCards(); System.out.println(drawnCards); System.out.println(missingCards); Card c1 = null; for (Card c : drawnCards){ c1 = c; } System.out.println("C1 is "+c1); for (Card c : missingCards){ System.out.println("C is "+c); System.out.println("Does c1.equal(c) "+c1.equals(c)); System.out.println("Does c.equal(c1) "+c.equals(c1)); } System.out.println("Is c1 in missingCards "+missingCards.contains(c1)); assertEquals("Deck confirm missing cards",drawnCards,missingCards); } (Edit: Just for clarity I added the two loops after I noticed the test failing. The first loop pulls out a card from drawnCards and then this card is checked against every card in missingCards - it always matches one, so that card must be contained in missingCards. However, missingCards.contains() fails) And here is an example of it's output: [5C, 2C, 2H] [2C, 5C, 2H] C1 is 2H C is 2C Does c1.equal(c) false Does c.equal(c1) false C is 5C Does c1.equal(c) false Does c.equal(c1) false C is 2H Does c1.equal(c) true Does c.equal(c1) true Is c1 in missingCards false I am completely sure that the implementation of .equals on my card class is correct and, as you can see from the output it does work! What is going on here? Cheers, Pete

    Read the article

  • How to set background color of a View

    - by Peter vdL
    I'm trying to set the background color of a View (in this case a Button). I use this code: // set the background to green v.setBackgroundColor(0x0000FF00 ); v.invalidate(); It causes the Button to disappear from the screen. What am I doing wrong, and what is the correct way to change the background color on any View? Thanks.

    Read the article

  • Capturing Set Behavior with Mutating Elements

    - by Carl
    Using the Guava library, I have the following situation: SetMultimap<ImmutableFoo, Set<Foo>> setMM = HashMultimap.create(); Set<Foo> mask = Sets.newHashSet(); // ... some iteration construct { setMM.put(ImmutableFoo1, Sets.difference(SomeSetFoo1,mask)); setMM.put(ImmutableFoo1, Sets.difference(SomeSetFoo2,mask)); mask.add(someFoo); } that is, the same iteration to create the setMM is also used to create the mask - this can of course result in changes to hashCode()s and create duplicates within the SetMultimap backing. Ideally, I'd like the duplicates to drop without me having to make it happen, and avoid repeating the iteration to separately construct the multimap and mask. Any easy libraries/Set implementations to make that happen? Alternatively, can you identify a better way to drop the duplicates than: for (ImmutableFoo f : setMM.keySet()) setMM.putAll(f,setMM.removeAll(f)); revisiting the elements is probably not a performance problem, since I could combine a separate filter operation that needs to visit all the elements anyway.

    Read the article

  • CMD For Loop does not hold set /a value

    - by Bob Hope
    Didn't know how to explain this well, so here is the code @echo off set test=0 for /f %%a in (textfile.txt) do ( rem loops five times(5 lines in textfile.txt) set /a test=test+1 rem Adds 1 to Test echo %%a rem Echo's correct line in file echo %test% rem Echo's whatever X was before the loop ) echo %test% rem Displays the correct value of X pause this is just an example of where I am finding the problem, txtfile.txt has 5 lines, so the for loop goes 5 times, each time, test gets +1 to it, and the /a displays the correct value of X, but the last echo on the for loop displays 0, which is what test is set to before the loop. The value of test is not changing until the loop is finished... is there any way to fix this? Here is what I want to accomplish, as there may be an easier way: I want to run a for loop that findstr's all rtf's in a series of sub folders, and copies them all to a all directory with a new name, 1.rtf,2.rtf,3.rtf, etc. The reason I need to rename them on the transfer is they all have the same name.

    Read the article

  • Does the SPDY protocol eliminate the need for cookieless domains?

    - by Clint Pachl
    With plain HTTP, cookieless domains were an optimization to avoid unnecessarily sending cookie headers for page resources. However, the SPDY protocol compresses HTTP headers and in some cases eliminates unnecessary headers. My question then is, does SPDY make cookieless domains irrelevant? Furthermore, should the page source and all of its resources be hosted at the same domain in order to optimize a SPDY implementation?

    Read the article

  • Pulling a value from one jQuery function into another

    - by Travis
    I'm trying to take the hex value chosen from a jQuery colorpicker plugin, and store it as a cookie using the jQuery cookie plugin. I just don't know the appropriate way to tie the two together (new to js and jQuery). Here's my colorpicker function: $('#colorSelector').ColorPicker({ color: '#ffffff', onShow: function (colpkr) { $(colpkr).fadeIn(500); return false; }, onHide: function (colpkr) { $(colpkr).fadeOut(500); return false; }, onChange: function (hsb, hex, rgb) { $('#colorSelector div, .preview-image, .cover ').css('backgroundColor', '#' + hex); $('body').css('backgroundColor', '#' + hex); $.cookie('bgColor', 'picker'); return false; } }); And here's my cookie function as is: var bgColor = $.cookie('bgColor'); if (bgColor == 'picker') { $('#colorSelector div, .preview-image, .cover ').css('backgroundColor', '#' + hex); }; I can set and store the cookie value as a standard css background-color, but can't figure out how to pull the "'backgroundColor', '#' + hex" value into the cookie function.

    Read the article

  • How to use java.Set

    - by owca
    I'm trying to make it working for quite some time,but just can't seem to get it. I have object Tower built of Block's. I've already made it working using arrays, but I wanted to learn Set's. I'd like to get similar functionality to this: public class Tower { public Tower(){ } public Tower add(Block k1){ //(...) //if block already in tower, return "Block already in tower" } public Tower delete(Block k1){ //(...) //if block already dleted, show "No such block in tower" } } Someone gave me some code, but I constantly get errors when trying to use it : Set<Block> tower = new HashSet<Block>(); boolean added = tower.add( k1 ); if( added ) { System.out.println("Added 1 block."); } else { System.out.println("Tower already contains this block."); } How to implement it ?

    Read the article

  • Adjacency List Tree Using Recursive WITH (Postgres 8.4) instead of Nested Set

    - by Koobz
    I'm looking for a Django tree library and doing my best to avoid Nested Sets (they're a nightmare to maintain). The cons of the adjacency list model have always been an inability to fetch descendants without resorting to multiple queries. The WITH clause in Postgres seems like a solid solution to this problem. Has anyone seen any performance reports regarding WITH vs. Nested Set? I assume the Nested set will still be faster but as long as they're in the same complexity class, I could swallow a 2x performance discrepancy. Django-Treebeard interests me. Does anyone know if they've implemented the WITH clause when running under Postgres? Has anyone here made the switch away from Nested Sets in light of the WITH clause?

    Read the article

< Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >