Search Results

Search found 3284 results on 132 pages for 'sessions'.

Page 14/132 | < Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >

  • Xpages - Get number of active sessions

    - by Jairo
    How do I get the number of active sessions in Xpage. I'm trying to use managed beans but it just returns a weird string. Here's the simple code: import javax.servlet.http.HttpSessionEvent; import javax.servlet.http.HttpSessionListener; public class SessionCounterListener implements HttpSessionListener { private static int totalActiveSessions; public static int getTotalActiveSessions(){ return totalActiveSessions | 0; } public void sessionCreated(HttpSessionEvent arg0) { totalActiveSessions++; System.out.println("sessionCreated - add one session into counter"); } public void sessionDestroyed(HttpSessionEvent arg0) { totalActiveSessions--; System.out.println("sessionDestroyed - deduct one session from counter"); } } I got this from here. But when I call SessionCounterListener.getTotalActiveSessions(), it only returns a weird string, example com.gs3.beans.SessionCounterListener@46c446c4. Please help me. Thanks a lot!

    Read the article

  • PHP: Alternative to SESSIONS

    - by iamjonesy
    Hi, I have a PHP application that relies on session variables quite a lot. After login the user get redirected to a page that executes code to set up a load of session variables depending on who the user is. The application is using data from different sources and the sessions are used to store ID numbers to query the databases. So when the user goes to a page that will query their asset management system their ID for that particular database is called via the session. I've had a LOT of problems with session variables recently. Sometimes only one session file is created during the lifetime of the app, and sometimes each session request results in a new session id (still haven't managed to find out why!). My question is this. Is there an alternative to using session variables for this? Like globals or some other way? Any help most appreciated! Regards, Jonesy

    Read the article

  • Best way to save complex Python data structures across program sessions (pickle, json, xml, database

    - by Malcolm
    Looking for advice on the best technique for saving complex Python data structures across program sessions. Here's a list of techniques I've come up with so far: pickle/cpickle json jsonpickle xml database (like SQLite) Pickle is the easiest and fastest technique, but my understanding is that there is no guarantee that pickle output will work across various versions of Python 2.x/3.x or across 32 and 64 bit implementations of Python. Json only works for simple data structures. Jsonpickle seems to correct this AND seems to be written to work across different versions of Python. Serializing to XML or to a database is possible, but represents extra effort since we would have to do the serialization ourselves manually. Thank you, Malcolm

    Read the article

  • Sessions and uploadify

    - by Uffo
    I'm using uploadify, and i can't set sessions in my php files, my script looks like this: $("#uploadify").uploadify({ 'uploader' : '/extra/flash/uploadify.swf', 'script' : '/admin/uploads/artistsphotos', 'scriptData' : {'PHPSESSID' : '<?= session_id(); ?>'}, 'cancelImg' : '/images/cancel.png', 'folder' : '/img/artists', 'queueID' : 'fileQueue', 'auto' : false, 'multi' : true, 'onComplete' : function(a, b, c, d, e){ }, 'onAllComplete': function(event,data){ $bla = $('#art').find(':selected',this); $fi = $bla.val(); $.ajax({ type: "POST", url: "/admin/uploads/artistsphotosupload", data: "artist="+$fi, success: function(msg){ console.log(msg); } }); } }); And in php if i try: $_SESSION['name'] = 'something'; I can't access it in another file.and i have session_start(); activated Any solutions?

    Read the article

  • Exception "Illegal attempt to associate a collection with two open sessions" when saving object

    - by Alex
    I am using CastleProject ActiveRecord and I use lazy load feature of this ORM. In order to make lazy load work, it is required to create SessionScope. I do this in Program.cs: public static SessionScope sessionScope; private static void InitializeActiveRecord() { ActiveRecordStarter.Initialize(); sessionScope = new SessionScope(); } This works fine for loading, however, when I try to save my objects, I get an exception saying "Illegal attempt to associate a collection with two open sessions". I guess this is due to the fact that I created one session myself. How to avoid this exception?

    Read the article

  • Approaches to timing out sessions on a web app using AJAX autorefreshes

    - by Braintapper
    I'm writing a web application that autorefreshes data with an AJAX call at set intervals. Because it's doing that, server side user sessions never time out, since the last activity is refreshed with every ajax call. Are there good client side rules I could implement to time out the user? I.e. should I track mouse movements in the browser, etc., or should I point the AJAX calls to URLs that don't refresh the session? I like that my AJAX calls hit a session-enabled URL, because I can also validate that the user is logged in, etc. Any thoughts in terms of whether I should even bother timing out the users?

    Read the article

  • PHP REMOTE_ADDR and secure sessions

    - by Christopher McCann
    One of the ways I have used to make securer sessions in the past is to also record the clients IP address and user agent at the handshake. Each time the client moves a page and calls session_start() I also check that the IP address and user agent stored is still the same to prevent hiijacking. But if someone is connecting from say a company network then all the users will probably have the same external static IP address and they could also really easily be using the same user agent. Is there other metrics I can use which are local only to the physical machine? Thanks

    Read the article

  • SQL Server to manage ASP.NET sessions doesn't work

    - by windforceus
    I follow the direction in here How to configure SQL Server to manage ASP.NET sessions to create ASPState db. I have 2 web application in IIS 7. In IIS web application setting, i go to "Session State" and set session state as "SQL Server" and provide connection string. In each web application web.config, i add <sessionState mode="SQLServer" allowCustomSqlDatabase="false" sqlConnectionString="data source=server;user id=user;password=password" cookieless="false" timeout="7200" /> I create a session , Session["Data"] = "test" in Web App A and go to Web App B in the same browser to print it Response.Write(Session["Data"]); It shows NOTHING. I can see there are data in table : ASPStateTempApplications and ASPStateTempSessions under ASPState Database. Also, i dont see any error in event log. Can anyone think anything i may do wrong? Thanks!!

    Read the article

  • PHP Security checklist (injection, sessions etc)

    - by NoviceCoding
    So what kind of things should a person using PHP and MySql be focused on to maximize security. Things I have done: -mysql_real_escape_string all inputs -validate all inputs after escaping em -Placed random alpha numerics before my table names -50character salt + Ripemd passwords Heres where I think I am slacking: -I know know nothing about sessions and securing them. How unsafe/safe is it if all you are doing is: session_start(); $_SESSION['login']= $login; and checking it with: session_start(); if(isset($_SESSION['login'])){ -I heard something about other forms of injection like cross site injection and what not... -And probably many other things I dont know about. Is there a "checklist"/Quicktut on making php secure? I dont even know what I should be worried about.I kinda regret now not building off cakephp since I am not a pro.

    Read the article

  • PHP Sessions Error

    - by Andrei Korchagin
    I'm new to PHP sessions and I've come across the following error: Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at somefile:someline). As well as this one: Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent by (output started at somefile:someline). The session_start(); is the very first thing in all of my code. I'm not sure what the problem is. It gave me line numbers but all I do on those lines is start the session. Also - I have a portion of code whose POST action is another PHP page. How can I set a $_SESSION variable pertaining to this page within that action page?

    Read the article

  • store data in asp.net pages (Not Sessions)

    - by ARB
    I am creating 4 asp.net pages. first three pages have 'CONTINUE' button and last page has 'SUBMIT' button. I am not allowed to use Sessions to store first three pages data. and i need to use 'BACK' button on last three pages. when i click 'BACK' button i need to maintain the previous page data entered by user. As my pages do some postbacks, i cannot use javascript.history function. My restrictions are: As the application is served from a web farm, a session object cannot be used. However, for the purpose of this excersise, consider session object as database-like persistent space where you can store your data. your code should show an easy way to switch to a different persistent space. What is databse like persistent space and how to write a code to switch to different persistent space?... Please give me some idea on how to proceed.... Thank you

    Read the article

  • Google app engine sessions now supported???

    - by user246114
    Hi, I thought google app engine did not support sessions (last time I checked was a few months ago). Now I was searching again for it and saw this: http://code.google.com/appengine/docs/java/config/appconfig.html#Enabling_Sessions says it supports: javax.servlet.http.HttpSession does this mean we have servlet session support now? If so, does anyone have an example of using this? I wanted to create my own User class and support user login and session management (I know app engine already supports this for google users, but wanted my own users for various requirements) Thanks!

    Read the article

  • Connection: Keep-Alive and PHP sessions not working

    - by user366667
    We have a VB application that needs to run an specific flow on a PHP page. This application was correctly catching the PHPSESSID cookie and using it for all subsequent requests. However, PHP wasn't able to restore any changes made on $_SESSION variable. The variable was changed, saved, and on the next request it was restored as an empty array. We found out that changing the Connection header from "Keep-Alive" to "Close" fixed the issue. I couldn't find anything on the web saying that PHP sessions shouldn't be restored under Keep-Alive connections. Does anyone know why this was happening? PS: We didn't find anything weird or different on Apache, ModSecurity or PHP configuration settings.

    Read the article

  • Removing $_SESSION['layout']['action'] globally from all users!

    - by sologhost
    Ok, I am storing a session variable like so to load up users layouts faster if it's set instead of calling the database. But since the layout can be changed via the Administrator, I'd like to be able to globally remove all sessions where $_SESSION['layout']['action'] is set for all users. $_SESSION['layout']['action'] = array(a ton of indexes and mulit-dimensional arrays); Now, I know it's being stored into my database sessions table, there's a column for session_id, last_update, and data. So, question I have is how to remove that session array key ['action'] from all users. Using $_SESSION = array(); session_destroy(); Does not work. Basically, session_start() is being loaded on every page load, so I just want to remove all ['action'] keys from ['layout']. Is this possible to do? Thanks

    Read the article

  • session_start() Hangs The Server

    - by Narcissus
    Totally confused by this one... We have a WAMPServer installation set up, running a number of virtual hosts from various document roots. Just recently, one particular domain has started hanging the server. We traced it down to session_start(). If we comment it out, there are no problems (except, of course, for the fact that we can't do anything with the session). With it uncommented, it will hang the page load and, with enough reloads, will hang the entire server. All of the other sites still work perfectly with their sessions. As far as I know, there is nothing different with the way sessions are being worked with. I am looking further into it (in case someone changed something) but right now I'm hoping for some direction :) So, any thoughts?

    Read the article

  • how to verify that an old session is really destroyed?

    - by jodeci
    Um, this might sound a bit weird. We were having some problems with a specific browser under a very specific condition, and finally narrowed down the problem to the fact that we were not properly destroying the old sessions after doing session_regenerate_id(). I believe I have solved this problem by doing session_regenerate_id(true) now, but how does one verify that the previous sessions really do not exist any more? Someone suggested cURL but I cannot find my way around their docs. Sadly(?) the boss does not take 'it just works' for an answer so I'd really appreciate any advice!

    Read the article

  • Autofac WCF integration + sessions

    - by Michael Sagalovich
    I am having an ASP.NET MVC 3 application that collaborates with a WCF service, which is hosted using Autofac host factory. Here are some code samples: .svc file: <%@ ServiceHost Language="C#" Debug="true" Service="MyNamespace.IMyContract, MyAssembly" Factory="Autofac.Integration.Wcf.AutofacServiceHostFactory, Autofac.Integration.Wcf" %> Global.asax of the WCF service project: protected void Application_Start(object sender, EventArgs e) { ContainerBuilder builder = new ContainerBuilder(); //Here I perform all registrations, including implementation of IMyContract AutofacServiceHostFactory.Container = builder.Build(); } Client proxy class constructor (MVC side): ContainerBuilder builder = new ContainerBuilder(); builder.Register(c => new ChannelFactory<IMyContract>( new BasicHttpBinding(), new EndpointAddress(Settings.Default.Url_MyService))) .SingleInstance(); builder.Register(c => c.Resolve<ChannelFactory<IMyContract>>().CreateChannel()) .UseWcfSafeRelease(); _container = builder.Build(); This works fine until I want WCF service to allow or require sessions ([ServiceContract(SessionMode = SessionMode.Allowed)], or [ServiceContract(SessionMode = SessionMode.Required)]) and to share one session with the MVC side. I changed the binding to WSHttpBinding on the MVC side, but I am having different exceptions depending on how I tune it. I also tried changing AutofacServiceHostFactory to AutofacWebServiceHostFactory, with no result. I am not using config file as I am mainly experimenting, not developing real-life application, but I need to study the case. But if you think I can achieve what I need only with config files, then OK, I'll use them. I will provide exception details for each combination of settings if required, I'm omitting them not to make the post too large. Any ideas on what I can do?

    Read the article

  • Cross domains sessions - shared shopping cart cross domains

    - by Jaroslav Moravec
    Hi, we are solving the problem with eshop (php, mysql). The client want to have the same eshop on two domains with shared shopping cart. In the shop customer can do the shopping without users account (can't be logged in). And there is the problem, how to make the shared shopping cart cross domain. The data from cart is stored in sessions, which we stored in database too. But we can't solve the problem in carrying data over domains. Identifying unlogged user is not holeproof (research). The example, how it should work Customer goes to domainOne and add some things to the cart. Than he goes to domainTwo (by link, typing domain address, however) and add some other things to the cart. In the cart he has things from both domains (after refreshing page). Do you have any idea, how to solve this problem? What didn't work: redirecting is not possible due to customer requirments cookies are related to domain set_cookie with the other domain didn't work the simpliest way is to carry over only the sessionid (stored in cookies) but we don't know, how to wholeproof identify unlogged users. is there any other place, where data can be stored on client side except cookies? (probably not) we can't use sending sessionid by params in url (if user click to link to the other domain) or resolving the header referer, bcs we don't know, how user can achieve the other domain. If you can't understand me, take me a question. If you think, that having eshop on two domains with shared (common) cart is bad idea, don't tell me, we know it. Thanks for each answer.

    Read the article

  • Sharing sessions across applications using the ASP.NET Session State Service

    - by Dan
    I am trying to share sessions between two web applications, both hosted on the same server. One is a .net 2.0 web forms application the other is as .net 3.5 MVC2 application. Both apps have their session set up like this: <sessionState mode="StateServer" stateConnectionString="tcpip=127.0.0.1:42424" /> In the webform application I am posting the the session key to the MVC app: protected void LinkButton1_Click(object sender, EventArgs e) { Session["myvariable"] = "dan"; string sessionKey = HttpContext.Current.Session.SessionID; //Followed by some code that posts sessionKey to the other application } I then recieve it in the MVC application and try use the same session like this: [HttpPost] public void Recieve(string sessionKey ) { var manager = new SessionIDManager(); bool redirected; bool IsAdded; manager.SaveSessionID(HttpContext.ApplicationInstance.Context, Id, out redirected, out IsAdded); var sessionKey = Session["myvariable"]; } The key is being posted but the session does not seem to get loaded in the MVC app, i.e. sessionKey is null. Can what I am trying to do be done?

    Read the article

  • php sessions not working

    - by Elwhis
    Hey guys, I have a problem, tried to google some sollutions but without success. I am working with wamp2.0 - PHP 5.3, apache 2.2.11 but my sessions are not storing data. I have a page that accepts a parameter, which (simplified version) I wanna store in a session, so I when I come to www.example.com/home.php?sessid=db_session_id the script looks like: session_start(); $sessid = @$_GET['sessid']; if ($sessid) { $_SESSION['sessid'] = $sessid; } var_dump($_SESSION); and outputs: array(1) { [0]=> string(13) "db_session_id" } which is fine, but then, when I go to www.example.com/home.php (without the sessid parameter) the $_SESSION array is empty. I've event tried to comment the $_SESSION['sessid'] = $sessid; line before going to the page without the parameter, but still it didin't work. I've checked the session_id() output and the session id remains the same. Session settings from phpinfo() Session Support enabled Registered save handlers files user Registered serializer handlers php php_binary wddx Directive Local Value Master Value session.auto_start Off Off session.bug_compat_42 On On session.bug_compat_warn On On session.cache_expire 180 180 session.cache_limiter nocache nocache session.cookie_domain no value no value session.cookie_httponly Off Off session.cookie_lifetime 0 0 session.cookie_path / / session.cookie_secure Off Off session.entropy_file no value no value session.entropy_length 0 0 session.gc_divisor 1000 1000 session.gc_maxlifetime 1440 1440 session.gc_probability 1 1 session.hash_bits_per_character 5 5 session.hash_function 0 0 session.name PHPSESSID PHPSESSID session.referer_check no value no value session.save_handler files files session.save_path c:/wamp/tmp c:/wamp/tmp session.serialize_handler php php session.use_cookies On On session.use_only_cookies On On session.use_trans_sid 0 0 EDIT: $_SESSION and $_COOKIE var dumps right after session_start() Session: array(1) { ["sessid"]=> string(0) "" } Cookie: array(6) { ["ZONEuser"]=> string(10) "3974260089" ["PHPSESSID"]=> string(26) "qhii6udt0cghm4mqilctfk3t44" ["__utmz"]=> string(91) "1.1294313834.54.3.utmcsr=u.cz|utmccn=(referral)|utmcmd=referral|utmcct=/registered/packages" ["__utma"]=> string(48) "1.1931776919.1287349233.1294266869.1294313834.54" ["__utmc"]=> string(1) "1" ["__utmb"]=> string(18) "1.49.10.1294313834" }

    Read the article

  • How to use sessions in PDO?

    - by Byakugan
    I am still redoing and getting rid of old mysql_* commands in my code. I tried to transfer my session login form old code and this is what I got so far: public function login($user, $password) { if (!empty($user) && !empty($password)) { $password = $web->doHash($user, $password); // in this function is (return sha1(strtoupper($user).':'.strtoupper($password)) $stmt = $db_login->prepare("SELECT * FROM account WHERE username=:user AND pass_hash=:password"); $stmt->bindValue(':user', $user, PDO::PARAM_STR); $stmt->bindValue(':password', $password, PDO::PARAM_STR); $stmt->execute(); $rows = $stmt->rowCount(); if ($rows > 0) { $results_login = $stmt->fetch(PDO::FETCH_ASSOC); $_SESSION['user_name'] = $results_login['username']; $_SESSION['user_id'] = $results_login['id']; return true; } else { return false; } } else { return false; } } After that I am using checks if user logged on site: public function isLogged() { return (!empty($_SESSION['user_id']) && !empty($_SESSION['user_name'])); } But it seems - this function returns always empty because $_SESSION does not exists in PDO? And of course logout is used in this form on my sites: public function logout() { unset($_SESSION['user_id']); unset($_SESSION['user_name']); } But I think PDO has different way of handling session? I did not find any so what is it can i somehow add $_SESSION in PDO withou changing code much? I am using variables $_SESSION['user_name'] and $_SESSION['user_id'] in all over my web project. Summary: 1) How to use sessions in PDO correctly? 2) What is difference between using $stmt->fetch(PDO::FETCH_ASSOC); and $stmt->fetchAll(); Thank you.

    Read the article

  • JavaOne Latin America 2011: Keynotes, Sessions, Hands-on Lab, Geek Bike Ride, etc.

    - by arungupta
    After a very successful JavaOne San Francisco, the first JavaOne on the road for 2011 is heading to Latin America next week. There are 59 sessions delivered by several rock star speakers and with 60% sessions delivered by the local community. There are strategy, technical and community keynotes. The community keynote on Thursday will particularly be lot of fun with appearances from Java Champions, JUG leaders, jHome, and several others. Also check out the Exhibitor Floor Plan and don't forget to Register! The complete session schedule gives an overview for the list of technical sessions and hands-on lab. There are several Java EE, GlassFish, and WebLogic sessions and are highlighted below: Tuesday, Dec 6 Oracle WebLogic Server XML-Free Programming: Java Server and Client Development without <> Java EE Application in Production: Tips and Tricks to achieve zero downtime Web Applications and Wicket Scala on GlassFish and Java EE 6 REST and Java best practices, issues and solutions for the Enterprise Building a RESTful Web Application with JAX-RS and Ext JS 4 Wednesday, Dec 7 Oracle GlassFish Server in the Virtual World JAX-RS 2.0: What's in JSR 339 ? JSF 343: What's coming in Java Message Service 2.0 ? The Great News of JSF 2.0! Thursday, Dec 8 Servlet 3.1 Update Develop, Deploy, and Monitor a Java EE 6 Application with Clustered GlassFish 3.1 Migrating from EJB/SOAP to REST with JAX-RS: The Case of the Central Bank of Brazil GlassFish REST Administration Back End: An Insider look at a real REST Application Scripting and Agile Java EE Applications with Jython And this is Brazil so a fun element is important. There are the usual Caiprihinas, Churrascaria, late night social dinners, community engagement, and multiple other fun activities. Fabiane Nardon and SOUJava gang are also organizing a Geek Bike Ride on the Sunday (Dec 4th) before JavaOne. The 20k ride (map) starts at 7am and goes through the streets of Sao Paulo. This is an opportunity to meet some of the JavaOne speakers and attendees outside the conference. They've even designed a t-shirt and 32 geeks have signed up so far. I'm glad my discussion with Fabiane during FISL early this year for arranging this bike ride is finally taking shape! I'm definitely looking forward to it and will be bringing nice fruity Odwalla bars for all the riders. Be there to ride with me and many others :-) Stay updated by following @oracledobrasil and @javaoneconf. I'll be there, will you ? Don't wait and register now! And in case you are interested in reading about the experience from last year ... it was lot of fun! Just check out a collage of pictures yourself ... And the complete album at:

    Read the article

  • HAProxy: session stickiness triggered by response header possible?

    - by zoli
    I'm investigating HAProxy as a possible replacement for F5. F5 is capable of persisting a session based on a response header value: when HTTP_RESPONSE { set session [HTTP::header X-Session] if {$session ne ""} { persist add uie $session } } and then route all subsequent requests which contain the same session ID in a header, query parameter, path, etc. to the same machine, eg: when HTTP_REQUEST { set session [findstr [HTTP::path] "/session/" 9 / if {$session} { persist uie $session } } I'm wondering if this is even possible to do with HAProxy?

    Read the article

  • Pfsense: Inbound Load Balancing https with sticky connection

    - by Zeux
    first of all I'm very sorry for my English... This is my scenario: Internet Firewall+LB: pfsense_1(Active) + pfsense_2(Passive) in CARP Pool servers: 3 x nginx(PHP5+HTTP+HTTPS) Pfsense 1 and 2 CARP configured with Virtual IP (pubblic). Nginx servers's ips are all private. I want to load balance inbound HTTP and HTTPS connections between the 3 nginx web servers. An importat thing is that the HTTPS connections must be "sticky connections": in HTTPS connections, after login by username and password, I setup a php session and therefore when a client starts a HTTPS connection it will be always redirected to the same nginx server, until it disconnects itself, it closes the page/browser or after a timeout (30minutes?) without activity. Is this possible whit the last release(2.0.1) of pfsense? thank you very much...

    Read the article

  • Unable to logoff, disconnect, or reset terminal server user in production environment

    - by l0c0b0x
    I'm looking for some ideas on how to disconnect, logoff, or reset a user's session in a 2008 Terminal Server (unable to login as the user either as it is completely locked-up). This is a production environment, so rebooting the server or doing something system-wide is out of the question for now. Any Powershell tricks to help us with this? We've tried killing the session's processes too, directly from the same terminal server (from the task manager, Terminal Services Manager and the Resource Monitor) with no results. Help!

    Read the article

< Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >