Search Results

Search found 1926 results on 78 pages for 'cookie monster'.

Page 49/78 | < Previous Page | 45 46 47 48 49 50 51 52 53 54 55 56  | Next Page >

  • How to generate custom JSESSIONID, based on some hash of user's data?

    - by Shaman
    Is it possible to override Tomcat's embedded generator of JSESSIONID, to be able to create custom values of this cookie, based on user's login? Why do I need this: I have a load balancer with "sticky sessions", configured to route requests with the same JSESSIONID to the same server, and I want to prevent situation, when same user can start two different sessions on different servers.

    Read the article

  • Drupal incorrectly escapes tags in javascript

    - by sergdev
    I installed drupal-6.16. I applied the patch from the post http://drupal.org/node/222926#comment-930745. It works correctly in simple cases. But following code of counter is handled incorrectly and counter is now displayed on the page after drupal. Drupal modifies the string "alt='1Gb.ua counter' /><\/a>")</a></script> to "alt='1Gb.ua counter' />&lt;\/a>")</a></script> The full code of counter follows: <br><br> Text <br><br> <!-- counter.1Gb.ua --> <script language="javascript" type="text/javascript"> cgb_js="1.0"; cgb_r=""+Math.random()+"&r="+ escape(document.referrer)+"&pg="+ escape(window.location.href); document.cookie="rqbct=1; path=/"; cgb_r+="&c="+ (document.cookie?"Y":"N"); </script><script language="javascript1.1" type="text/javascript"> cgb_js="1.1";cgb_r+="&j="+ (navigator.javaEnabled()?"Y":"N")</script> <script language="javascript1.2" type="text/javascript"> cgb_js="1.2"; cgb_r+="&wh="+screen.width+ 'x'+screen.height+"&px="+ (((navigator.appName.substring(0,3)=="Mic"))? screen.colorDepth:screen.pixelDepth)</script> <script language="javascript1.3" type="text/javascript"> cgb_js="1.3"</script> <script language="javascript" type="text/javascript">cgb_r+="&js="+cgb_js; document.write("<a href='http://www.1Gb.ua?cnt=1416'>"+ "<img src='http://counter.1Gb.ua/cnt.aspx?"+ "u=1416&"+cgb_r+ "&' border=0 width=88 height=31 "+ "alt='1Gb.ua counter'><\/a>")</script> <noscript><a href='http://www.1Gb.ua?cnt=1416'> <img src="http://counter.1Gb.ua/cnt.aspx?u=1416" border=0 width="88" height="31" alt="1Gb.ua counter"></a> </noscript> <!-- /counter.1Gb.ua --> Does anybody have this code working? How can it be fixed? Thanks a lot in advance!

    Read the article

  • Does UserId data type affect FormsAuthentication.SetAuthCookie(UserId.ToString(), false)?

    - by FreshCode
    Does the original data type of the username string in a call to FormsAuthentication.SetAuthCookie(...) make any difference with regards to security or code maintainability? As I understand it, the cookie is encrypted and used to identify a user on each request. I'm curious whether it should affect the design of the primary key on my Users table in my database, eg. Guid vs int or a unique username string.

    Read the article

  • asp.net state server session - cross appDomain?

    - by newone1
    When using a State server for session, are sessions still appDomain specific? So for example, I have two different IIS applications(virtual directories) on a web server, and they both point to one state server for session. The session guid from the cookie will be the same across requests from both applications, so will the same session be accessible across both of these applications? Thanks.

    Read the article

  • Is it possible to use .ASPXAUTH for my own logging system?

    - by J. Pablo Fernández
    For a web application I switched from using ASP.NET Membership to using my own log in system which just does something like this to mark a user as logged in: Session["UserId"] = User.Id Is it possible to store the user id in the ASPXAUTH cookie, piggybacking on its encryption, instead of using the standard session? The goal is for the logged in state to last longer than a session and survive both browser and server restarts.

    Read the article

  • how to login in google account with app engine webproxy

    - by user313446
    hi,a webproxy on app engine oncyberspace.appspot.com , save cookie in the database, when i try to login in the google with my account, it redirect to google.com . how to solve these problem ? and another problem , when i this the above web to login in twitter,it works !but i can not use it to update my tweet. i don't know why, may be i can't pass oauth . how to solve this ?

    Read the article

  • How to create profiles for guests?

    - by Anant
    I'm making a site, and will be allowing guests to vote/comment. How should I go about storing the user info? I wouldn't like the info to be cleared if someone deletes the cookie (SO handles guest users via cookies I guess). If someone clears cookies and changes the ip at once, then only should the guest user info should be lost. Should I use sessions in php for this?

    Read the article

  • Why does firefox round-trip to the server to determine whether my files are modifed?

    - by erikkallen
    I have some static content on my web site that I have set up caching for (using Asp.NET MVC). According to Firebug, the first time I open the page, Firefox sends this request: GET /CoreContent/Core.css?asm=0.7.3614.34951 Host: 127.0.0.1:3916 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5 (.NET CLR 3.5.30729) Accept: text/css,*/*;q=0.1 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 300 Connection: keep-alive Referer: http://127.0.0.1:3916/Edit/1/101 Cookie: .ASPXAUTH=52312E5A802C1A079E2BA29AA2BFBC5A38058977B84452D62ED52855D4164659B4307661EC73A307BFFB2ED3871C67CB3A9AAFDB3A75A99AC0A21C63A6AADE9A11A7138C672E75125D9FF3EFFBD9BF62 Pragma: no-cache Cache-Control: no-cache Which my server replies to with this: Server: ASP.NET Development Server/9.0.0.0 Date: Mon, 23 Nov 2009 18:44:41 GMT X-AspNet-Version: 2.0.50727 X-AspNetMvc-Version: 1.0 Cache-Control: public, max-age=31535671 Expires: Tue, 23 Nov 2010 18:39:12 GMT Last-Modified: Mon, 23 Nov 2009 18:39:12 GMT Vary: * Content-Type: text/css Content-Length: 15006 Connection: Close So far, so good. However, if I refresh Firefox (not a cache-clearing refresh, just a normal one), during that refresh cycle Firefox will once again go to the server with this request: GET /CoreContent/Core.css?asm=0.7.3614.34951 Host: 127.0.0.1:3916 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5 (.NET CLR 3.5.30729) Accept: text/css,*/*;q=0.1 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 300 Connection: keep-alive Referer: http://127.0.0.1:3916/Edit/1/101 Cookie: .ASPXAUTH=52312E5A802C1A079E2BA29AA2BFBC5A38058977B84452D62ED52855D4164659B4307661EC73A307BFFB2ED3871C67CB3A9AAFDB3A75A99AC0A21C63A6AADE9A11A7138C672E75125D9FF3EFFBD9BF62 If-Modified-Since: Mon, 23 Nov 2009 18:39:20 GMT Cache-Control: max-age=0 to which my server responds 304 Not Modified. Why does Firefox issue this second request? In the first response, I said that the cache does not expire for a year (I intend to use query parameters whenever things change). Do I have to add another response header to prevent this extra roundtrip? Edit: It does not matter whether I press refresh, or whether I go to the page again (or a different URL, which references the same external files). Firefox does the same again. Also, I don't claim this to be a bug in FF, I just wonder if there is another header I can set which means "This document will never change, don't bother me again".

    Read the article

  • The explain tells that the query is awful (it doesn't use a single key) but I'm using LIMIT 1. Is th

    - by Ricardo
    The explain command with the query: explain SELECT * FROM leituras WHERE categorias_id=75 AND textos_id=190304 AND cookie='3f203349ce5ad3c67770ebc882927646' AND endereco_ip='127.0.0.1' LIMIT 1 The result: id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE leituras ALL (null) (null) (null) (null) 1022597 Using where Will it make any difference adding some keys on the table? Even that the query will always return only one row.

    Read the article

  • php cookies block access to directories

    - by user342391
    I have a mysql database of users that can login to my site and view content. I would like to block a couple of directories from certain users. What is the best way to do this. Currently when a user logs in a cookie is created with their customer id and the customer is is used to display their content. How would I block entire directories from my users???

    Read the article

  • How to share asp.net Session into WCF service

    - by Throjen
    Im using asp.net website with WCF service, having wsHttpBinding,Aspnet compatibility enabled, specified as Sessionmode -allowed, service behavior- isinitiated and client session cookie enabled. Its looking like Asp.Net session object and WCF Session( HTTPContext.Current.Session) work independently. How can I share Asp.net Session value to WCF Session and vise versa.

    Read the article

  • Having trouble understanding some code (Ruby on Rails)

    - by user284194
    I posted a question awhile ago asking how I could limit the rate at which a form could be submitted from a rails application. I was helped by a very patient user and their solution works great. The code was for my comments controller, and now I find myself wanting to add this functionality to another controller, my Messages controller. I immediately tried reusing the working code from the comments controller but I couldn't get it to work. Instead of asking for the working code, could someone please help me understand my working comment controller code? class CommentsController < ApplicationController #... before_filter :post_check def record_post_time cookies[:last_post_at] = Time.now.to_i end def last_post_time Time.at((cookies[:last_post_at].to_i rescue 0)) end MIN_POST_TIME = 2.minutes def post_check return true if (Time.now - last_post_time) > MIN_POST_TIME flash[:warning] = "You are trying to reply too fast." @message = Message.find(params[:message_id]) redirect_to(@message) return false end #... def create @message = Message.find(params[:message_id]) @comment = @message.comments.build(params[:comment]) if @comment.save record_post_time flash[:notice] = "Replied to \"#{@message.title}\"" redirect_to(@message) else render :action => "new" end end def update @message = Message.find(params[:message_id]) @comment = Comment.find(params[:id]) if @comment.update_attributes(params[:comment]) record_post_time redirect_to post_comment_url(@message, @comment) else render :action => "edit" end end #... end My Messages controller is pretty much a standard rails generated controller with a few before filters and associated private methods for DRYing up the code and a redirect for non existent pages. I'll explain how much of the code I understand. When a comment is created, a cookie is created with a last_post_time value. If they try to post another comment, the cookie is checked if the last one was made in the last two minutes. If it was a flash warning is displayed and no comment is recorded. What I don't really understand is how the post_check method works and how I can adapt it for my simpler posts controller. I thought I could reuse all the code in the message controller with the exception of the line: @message = Message.find(params[:message_id]) # (don't need the redirect code) in the post_check method. But it trips up on the "record_post_time" in the create action/method. I really want to understand this. Can someone explain why this doesn't work? I greatly appreciate you reading my lengthy question.

    Read the article

  • Drupal incorrectly espaces tags in javascript

    - by sergdev
    I installed drupal-6.16. I applied the patch from the post http://drupal.org/node/222926#comment-930745. It works correctly in simple cases. But for following code for counter is handled incorrectly: <br><br> Text <br><br> <!-- counter.1Gb.ua --> <script language="javascript" type="text/javascript"> cgb_js="1.0"; cgb_r=""+Math.random()+"&r="+ escape(document.referrer)+"&pg="+ escape(window.location.href); document.cookie="rqbct=1; path=/"; cgb_r+="&c="+ (document.cookie?"Y":"N"); </script><script language="javascript1.1" type="text/javascript"> cgb_js="1.1";cgb_r+="&j="+ (navigator.javaEnabled()?"Y":"N")</script> <script language="javascript1.2" type="text/javascript"> cgb_js="1.2"; cgb_r+="&wh="+screen.width+ 'x'+screen.height+"&px="+ (((navigator.appName.substring(0,3)=="Mic"))? screen.colorDepth:screen.pixelDepth)</script> <script language="javascript1.3" type="text/javascript"> cgb_js="1.3"</script> <script language="javascript" type="text/javascript">cgb_r+="&js="+cgb_js; document.write("<a href='http://www.1Gb.ua?cnt=1416'>"+ "<img src='http://counter.1Gb.ua/cnt.aspx?"+ "u=1416&"+cgb_r+ "&' border=0 width=88 height=31 "+ "alt='1Gb.ua counter'><\/a>")</script> <noscript><a href='http://www.1Gb.ua?cnt=1416'> <img src="http://counter.1Gb.ua/cnt.aspx?u=1416" border=0 width="88" height="31" alt="1Gb.ua counter"></a> </noscript> <!-- /counter.1Gb.ua --> It modifies the string "alt='1Gb.ua counter' /><\/a>")</a></script> to "alt='1Gb.ua counter' />&lt;\/a>")</a></script> Does anybody have this code working? If so how this can be fixed? Thanks a lot in advance!

    Read the article

  • how to implement single sign on for asp.net,mysql websites

    - by kranthi
    Hi, I am using mysql database for my asp.net website.I need to implement to single sign on for multiple instances of my website.Currently to check if a user has logged in I am using a user control which checks for a "loggedin" cookie with single instance of the website.Now I need to extend the logic to achieve single signon for multiple instances of the same site. Could someone please help. Thanks.

    Read the article

  • Mediawiki authenication replacement showing "Login Required" instead of signing user into wiki

    - by arcdegree
    I'm fairly to MediaWiki and needed a way to automatically log users in after they authenticated to a central server (which creates a session and cookie for applications to use). I wrote a custom authentication extension based off of the LDAP Authentication extension and a few others. The extension simply needs to read some session data to create or update a user and then log them in automatically. All the authentication is handled externally. A user would not be able to even access the wiki website without logging in externally. This extension was placed into production which replaced the old standard MediaWiki authentication system. I also merged user accounts to prepare for the change. By default, a user must be logged in to view, edit, or otherwise do anything in the wiki. My problem is that I found if a user had previously used the built-in MediaWiki authentication system and returned to the wiki, my extension would attempt to auto-login the user, however, they would see a "Login Required" page instead of the page they requested like they were an anonymous user. If the user then refreshed the page, they would be able to navigate, edit, etc. From what I can tell, this issue resolves itself after the UserID cookie is reset or created fresh (but has been known to strangely come up sometimes). To replicate, if there is an older User ID in the "USERID" cookie, the user is shown the "Login Required" page which is a poor user experience. Another way of showing this page is by removing the user account from the database and refreshing the wiki page. As a result, the user will again see the "Login Required" page. Does anyone know how I can use debugging to find out why MediaWiki thinks the user is not signed in when the cookies are set properly and all it takes is a page refresh? Here is my extension (simplified a little for this post): <?php $wgExtensionCredits['parserhook'][] = array ( 'name' => 'MyExtension', 'author' => '', ); if (!class_exists('AuthPlugin')) { require_once ( 'AuthPlugin.php' ); } class MyExtensionPlugin extends AuthPlugin { function userExists($username) { return true; } function authenticate($username, $password) { $id = $_SESSION['id']; if($username = $id) { return true; } else { return false; } } function updateUser(& $user) { $name = $user->getName(); $user->load(); $user->mPassword = ''; $user->mNewpassword = ''; $user->mNewpassTime = null; $user->setRealName($_SESSION['name']); $user->setEmail($_SESSION['email']); $user->mEmailAuthenticated = wfTimestampNow(); $user->saveSettings(); return true; } function modifyUITemplate(& $template) { $template->set('useemail', false); $template->set('remember', false); $template->set('create', false); $template->set('domain', false); $template->set('usedomain', false); } function autoCreate() { return true; } function disallowPrefsEditByUser() { return array ( 'wpRealName' => true, 'wpUserEmail' => true, 'wpNick' => true ); } function allowPasswordChange() { return false; } function setPassword( $user, $password ) { return false; } function strict() { return true; } function initUser( & $user ) { } function updateExternalDB( $user ) { return false; } function canCreateAccounts() { return false; } function addUser( $user, $password ) { return false; } function getCanonicalName( $username ) { return $username; } } function SetupAuthMyExtension() { global $wgHooks; global $wgAuth; $wgHooks['UserLoadFromSession'][] = 'Auth_MyExtension_autologin_hook'; $wgHooks['UserLogoutComplete'][] = 'Auth_MyExtension_UserLogoutComplete'; $wgHooks['PersonalUrls'][] = 'Auth_MyExtension_personalURL_hook'; $wgAuth = new MyExtensionPlugin(); } function Auth_MyExtension_autologin_hook($user, &$return_user ) { global $wgUser; global $wgAuth; global $wgContLang; wfSetupSession(); // Give us a user, see if we're around $tmpuser = new User() ; $rc = $tmpuser->newFromSession(); $rc = $tmpuser->load(); if( $rc && $rc->isLoggedIn() ) { if ( $rc->authenticate($rc->getName(), '') ) { return true; } else { $rc->logout(); } } $id = trim($_SESSION['id']); $name = ucfirst(trim($_SESSION['name'])); if (empty($dsid)) { $result = false; // Deny access return true; } $user = User::newFromName($dsid); if (0 == $user->getID() ) { // we have a new user to add... $user->setName( $id); $user->addToDatabase(); $user->setToken(); $user->saveSettings(); $ssUpdate = new SiteStatsUpdate( 0, 0, 0, 0, 1 ); $ssUpdate->doUpdate(); } else { $user->saveToCache(); } // update email, real name, etc. $wgAuth->updateUser( $user ); $result = true; // Go ahead and log 'em in $user->setToken(); $user->saveSettings(); $user->setupSession(); $user->setCookies(); return true; } function Auth_MyExtension_personalURL_hook(& $personal_urls, & $title) { global $wgUser; unset( $personal_urls['mytalk'] ); unset($personal_urls['Userlogin']); $personal_urls['userpage']['text'] = $wgUser->getRealName(); foreach (array('login', 'anonlogin') as $k) { if (array_key_exists($k, $personal_urls)) { unset($personal_urls[$k]); } } return true; } function Auth_MyExtension_UserLogoutComplete(&$user, &$inject_html, $old_name) { setcookie( $GLOBALS['wgCookiePrefix'] . '_session', '', time() - 3600, $GLOBALS['wgCookiePath']); setcookie( $GLOBALS['wgCookiePrefix'] . 'UserName', '', time() - 3600, $GLOBALS['wgCookiePath']); setcookie( $GLOBALS['wgCookiePrefix'] . 'UserID', '', time() - 3600, $GLOBALS['wgCookiePath']); setcookie( $GLOBALS['wgCookiePrefix'] . 'Token', '', time() - 3600, $GLOBALS['wgCookiePath']); return true; } ?> Here is part of my LocalSettings.php file: ############################# # Disallow Anonymous Access ############################# $wgGroupPermissions['*']['read'] = false; $wgGroupPermissions['*']['edit'] = false; $wgGroupPermissions['*']['createpage'] = false; $wgGroupPermissions['*']['createtalk'] = false; $wgGroupPermissions['*']['createaccount'] = false; $wgShowIPinHeader = false; # For non-logged in users ############################# # Extension: MyExtension ############################# require_once("$IP/extensions/MyExtension.php"); $wgAutoLogin = true; SetupAuthMyExtension(); $wgDisableCookieCheck = true;

    Read the article

  • How to set cookies via PHP in the middle of a document?

    - by Sam
    Hi all, how can I set cookies in the middle of a document, without incurring a 'headers already sent' error? What I'm trying to do is make a log out script (the log in cookie setting works...so odd. Is it because it's enclosed in an if statement?) however I've already echoed the page title and some other stuff at the top of the page, before I've made this logout happen. Thanks!

    Read the article

  • PHP apache_request_headers() diagrees with reality (as confirmed by Firebug): why?

    - by Peter Howe
    I have written a web app in PHP which makes use of Ajax requests (made using YUI.util.Connect.asyncRequest). Most of the time, this works fine. The request is sent with an X-Requested-With value of XMLHttpRequest. My PHP controller code uses apache_request_headers() to check whether an incoming request is Ajax or not and all works well. But not always. Intermittently, I'm getting a situation where the Ajax request is sent (and Firebug confirms for me that the headers on the request include an X-Requested-With of XMLHttpRequest) but apache_request_headers() is not returning that header in its list. The output from when I var_dump the apache_request_headers() is as follows (note the lack of X- 'Host' => string 'peterh.labs.example.com' (length=26) 'User-Agent' => string 'Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.9.0.3) Gecko/2008101315 Ubuntu/8.10 (intrepid) Firefox/3.0.3' (length=105) 'Accept' => string 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' (length=63) 'Accept-Language' => string 'en-gb,en;q=0.5' (length=14) 'Accept-Encoding' => string 'gzip,deflate' (length=12) 'Accept-Charset' => string 'ISO-8859-1,utf-8;q=0.7,*;q=0.7' (length=30) 'Keep-Alive' => string '300' (length=3) 'Connection' => string 'keep-alive' (length=10) 'Referer' => string 'http://peterh.labs.example.com/qmail/' (length=40) 'Cookie' => string 'WORKFLOW_SESSION=55f9aff2051746851de453c1f776ad10745354f6' (length=57) 'Pragma' => string 'no-cache' (length=8) 'Cache-Control' => string 'no-cache' (length=8) But Firebug tells me: Request Headers: Host peterh.labs.example.com User-Agent Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.9.0.3) Gecko/2008101315 Ubuntu/8.10 (intrepid) Firefox/3.0.3 Accept text/html,application/xhtml+xml,application/xml;q=0.9,**;q=0.8 Accept-Language en-gb,en;q=0.5 Accept-Encoding gzip,deflate Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive 300 Connection keep-alive X-Requested-With XMLHttpRequest Referer http://peterh.labs.example.com/qmail/ Cookie WORKFLOW_SESSION=55f9aff2051746851de453c1f776ad10745354f6 This mismatch is (apparently) intermittent when executing the same code. But I don't believe in "intermittent" when it comes to software! Help!

    Read the article

  • asp.net forms authentification security issues

    - by Andrew Florko
    Hi there, I have a kind of asp.net forms authentication with the code like that: FormsAuthentication.SetAuthCookie(account.Id.ToString(), true); HttpContext.Current.User = new GenericPrincipal(new GenericIdentity(account.Id.ToString()), null); What kind of additional efforts shall I take to make authentication cookie (that is user id) more securable? (https, encoding for example) Thank you in advance!

    Read the article

  • django multi-language (i18n) and seo

    - by fumer
    hi, I am developing a multi-language site in django. In order to improve SEO, i will give every language version a unique URL like below, english: www.foo.com/en/index.html french: www.foo.com/fr/index.html chinese: www.foo.com/zh/index.html However, Django looks for a "django_language" key in user's session or cookie to determine language in default, so,Despite which language user chose, URL is always the same. for instance: http://www.foo.com/index.html how to resolve this problem ? thank you!

    Read the article

< Previous Page | 45 46 47 48 49 50 51 52 53 54 55 56  | Next Page >