Search Results

Search found 15797 results on 632 pages for 'session variables'.

Page 75/632 | < Previous Page | 71 72 73 74 75 76 77 78 79 80 81 82  | Next Page >

  • How to secure Java webservices with login and session handling

    - by hubertg
    I'd like to secure my (Java metro) webservice with a login. Here's how I'm planning to do that: Steps required when calling a webservice method are: call login(user,pwd), receive a session token 1.1 remember the token call servicemethod (token, arg1, arg2...) webservice checks if the token is known, if not throw exception otherwise proceed logout or timeout after x time periods of inactivity my questions: 1. what's your opinion on this approach? does it make sense? 2. are there any libraries which take the burden of writing a session handling (maybe with database persistence to survive app restarts) (the solution should be simple and easily usable with Java and .NET clients) thanks!

    Read the article

  • How implement the Open Session in View pattern in NHibernate?

    - by MCardinale
    I'm using ASP.NET MVC + NHibernate + Fluent NHibernate and having a problem with lazy loading. Through this question (http://stackoverflow.com/questions/2519964/how-to-fix-a-nhibernate-lazy-loading-error-no-session-or-session-was-closed), I've discovered that I have to implement the Open Session in View pattern , but I don't know how. In my repositories classes, I use methods like this public ImageGallery GetById(int id) { using(ISession session = NHibernateSessionFactory.OpenSession()) { return session.Get<ImageGallery>(id); } } public void Add(ImageGallery imageGallery) { using(ISession session = NHibernateSessionFactory.OpenSession()) { using(ITransaction transaction = session.BeginTransaction()) { session.Save(imageGallery); transaction.Commit(); } } } And this is my Session Factory helper class: public class NHibernateSessionFactory { private static ISessionFactory _sessionFactory; private static ISessionFactory SessionFactory { get { if(_sessionFactory == null) { _sessionFactory = Fluently.Configure() .Database(MySQLConfiguration.Standard.ConnectionString(MyConnString)) .Mappings(m => m.FluentMappings.AddFromAssemblyOf<ImageGalleryMap>()) .ExposeConfiguration(c => c.Properties.Add("hbm2ddl.keywords", "none")) .BuildSessionFactory(); } return _sessionFactory; } } public static ISession OpenSession() { return SessionFactory.OpenSession(); } } Someone could help me to implements Open Session in View pattern? Thank you.

    Read the article

  • struts 2 bean is not created

    - by Dewfy
    Hello colleagues! At first some precondition to my question, I'm using struts2 + tiles2 + toplink. NO spring at all. The simplest scenario - is to display list of entities on the page. To optimize resolving JPA's EntityManager I would like to create helper (JPAResourceBean) that implements lazy load of entity manager. For this purposes I'm going to use struts2's bean declaration: <bean name="myfactory" class="my.model.JPAResourceBean" scope="session" optional="false"/> Why bean is not instantiated neither in session? (I'm using s:property just for debug) ... <s:property value="#session.myfactory" default="buka.1"/> ... nor in plain bean list: ... <s:property value="#myfactory" default="buka.2"/> ... May be the second part of question is - how to resolve this bean from java code?

    Read the article

  • Google App Engine - Calling getSession().invalidate(); causes app engine to act weird.

    - by Spines
    When I call hreq.getSession().invalidate(); app engine slows down tremendously. I looked at appstats and saw that on a page where no database calls are made, it was calling memcache.get and datastore.get 23 times each. The stack trace of these calls showed that it was being called from getSession(). This only happens on the production server. Every time I make a request to a page, it makes a bunch of memcache and datastore calls. This slow down goes away though when i restart my browser. When I changed the code to simply set the isLoggedIn property of the session to false, rather than calling hreq.getSession().invalidate();, everything was fine. As a test, I didn't invalidate my session, but I changed the value of my browser's session cookie, and the app engine exhibited the same behavior. Is this a bug with the app engine?

    Read the article

  • Relying on nhibernate's second level cache vs pushing objects into asp.net session

    - by AhmetC
    I have some big entities which are frequently accessed in the same session. For example, in my application there is a reporting page which consist of dynamically generated chart images. For each chart image on this page, the client makes requests to corresponding controller and the controller generates images using some entities. I can either use asp.net's session dictionary for "caching" those entities or rely on nhibernate's second level cache support with using cached queries for example. What is your opinion? By the way I will use shared hosting, is nhibernate's second level cache hosting friendly? Thanks.

    Read the article

  • Best way to deal with session handling in Zend Framework

    - by JACK IN THE CRACK
    So I'm starting up in Zend framework and looking to implement a site-wide "User" session.... something I can easily access from ALL modules/controllers in the application. I'm like, should I make a new namespace in the library and extend the controller, like: MyLib_Controller_Action extends Zend_Controller_Action { protected $_userSession; function preDispatch(Zend_Controller_Request_Abstract $req) { $this->_userSession = new Zend_Session_Namespace('user'); } } ANd then have all my controllers/modules/etc extend from that? Or should I create a Plugin or what? How would you go about making this plugin to pass the user session to the controller? Or do I do it in the bootstrap?? Again how to pass to controller? Also should I use Zend_Session_Namespace or Zend_Http_Cookie and also how do I encrypt and xss clean the cookie or is that did automagically?

    Read the article

  • Invalid AuthenticityToken everywhere

    - by bwizzy
    I have a rails app that I just deployed which is generating Invalid AuthenticityToken errors anywhere a form is submitted. The app uses subdomains as account names and will also eventually allow for a custom domain to be entered. I have an entry in production.rb to allow for cross-domain session handling. The problem is that you can't login / or submit any form because everything raises an Invalid AuthenticityToken error. The issue looks similar but not the same as http://stackoverflow.com/questions/1201901/rails-invalid-authenticity-token-after-deploy plus I'm not using mongrel. I've tried clearing cookies in the browser, and restarting passenger but no luck. Anyone have any ideas? The server is running nginx + passenger 2.3.11, and Rails 2.3.5. #production.rb config.action_controller.session[:domain] = '.domain.com' #environment.rb config.action_controller.session = { :session_key => '_app_session', :secret => '.... nums and chars .....' }

    Read the article

  • What to pass to UserType, BlobType.setPreparedStatement session parameter

    - by dlots
    http://blog.xebia.com/2009/11/09/understanding-and-writing-hibernate-user-types/ I am attempting to defined a customer serialization UserType that mimics, the XStreamUserType referenced and provided here: http://code.google.com/p/aphillips/source/browse/commons-hibernate-usertype/trunk/src/main/java/com/qrmedia/commons/persistence/hibernate/usertype/XStreamableUserType.java My serializer outputs a bytearray that should presumably written to a Blob. I was going to do: public class CustomSerUserType extends DirtyCheckableUserType { protected SerA ser=F.g(SerA.class); public Class<Object> returnedClass() { return Object.class; } public int[] sqlTypes() { return new int[] {Types.BLOB}; } public Object nullSafeGet(ResultSet resultSet,String[] names,Object owner) throws HibernateException,SQLException { if() } public void nullSafeSet(PreparedStatement preparedStatement,Object value,int index) throws HibernateException,SQLException { BlobType.nullSafeSet(preparedStatement,ser.ser(value),index); } } Unfortunetly, the BlobType.nullSafeSet method requires the session. So how does one define a UserType that gets access to a servlet requests session? EDIT: There is a discussion of the issue here and it doesn't appear there is a solution: Best way to implement a Hibernate UserType after deprecations?

    Read the article

  • Win32 -- Object cleanup and global variables

    - by KaiserJohaan
    Hello, I've got a question about global variables and object cleanup in c++. For example, look at the code here; case WM_PAINT: paintText(&hWnd); break; void paintText(HWND* hWnd) { PAINTSTRUCT ps; HBRUSH hbruzh = CreateSolidBrush(RGB(0,0,0)); HDC hdz = BeginPaint(*hWnd,&ps); char s1[] = "Name"; char s2[] = "IP"; SelectBrush(hdz,hbruzh); SelectFont(hdz,hFont); SetBkMode(hdz,TRANSPARENT); TextOut(hdz,3,23,s1,sizeof(s1)); TextOut(hdz,10,53,s2,sizeof(s2)); EndPaint(*hWnd,&ps); DeleteObject(hdz); DeleteObject(hbruzh); // bad? DeleteObject(ps); // bad? } 1)First of all; which objects are good to delete and which ones are NOT good to delete and why? Not 100% sure of this. 2)Since WM_PAINT is called everytime the window is redrawn, would it be better to simply store ps, hdz and hbruzh as global variables instead of re-initializing them everytime? The downside I guess would be tons of global variables in the end _ but performance-wise would it not be less CPU-consuming? I know it won't matter prolly but I'm just aiming for minimalistic as possible for educational purposes. 3) What about libraries that are loaded in? For example: // // Main // int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { // initialize vars HWND hWnd; WNDCLASSEX wc; HINSTANCE hlib = LoadLibrary("Riched20.dll"); ThishInstance = hInstance; ZeroMemory(&wc,sizeof(wc)); // set WNDCLASSEX props wc.cbSize = sizeof(WNDCLASSEX); wc.lpfnWndProc = WindowProc; wc.hInstance = ThishInstance; wc.hIcon = LoadIcon(hInstance,MAKEINTRESOURCE(IDI_MYICON)); wc.lpszMenuName = MAKEINTRESOURCE(IDR_MENU1); wc.hCursor = LoadCursor(NULL, IDC_ARROW); wc.hbrBackground = (HBRUSH)COLOR_WINDOW; wc.lpszClassName = TEXT("PimpClient"); RegisterClassEx(&wc); // create main window and display it hWnd = CreateWindowEx(NULL, wc.lpszClassName, TEXT("PimpClient"), 0, 300, 200, 450, 395, NULL, NULL, hInstance, NULL); createWindows(&hWnd); ShowWindow(hWnd,nCmdShow); // loop message queue MSG msg; while (GetMessage(&msg, NULL,0,0)) { TranslateMessage(&msg); DispatchMessage(&msg); } // cleanup? FreeLibrary(hlib); return msg.wParam; } 3cont) is there a reason to FreeLibrary at the end? I mean when the process terminates all resources are freed anyway? And since the library is used to paint text throughout the program, why would I want to free before that? Cheers

    Read the article

  • How to start a process from another application and then open a terminal to that process in gnu scre

    - by Charlie
    I'd like to be able to launch a process from a GUI application (right now I'm thinking specifically of letting an eclipse user -- possibly via a plugin -- click a button to launch a build using my organization's build system). I don't want this process to stop when I stop the parent application, and I want to be able to "switch into it" later, as though I launched it from a command line. I've seen GNU screen described as good for most of what I'm asking for, but I'm not sure about the "launch the process from another application" part. Can this be done if the GUI application was itself launched from within screen? Can this be done if it wasn't? I'd be very interested in seeing how! Update: Prepending "screen" to a command line looks like a good way to start a process in screen from a shell, but I'm trying to find a way to do this without being taken straight into that session. I want to "send" the command to a screen session, where it will be started in a new window in that session.

    Read the article

  • session state of checkbox list

    - by xrx215
    Can you please help me in storing the checkbox list items in session. I have a checkbox list as follows asp:CheckBoxList ID="cblScope" runat="server" onselectedindexchanged="cblScope_SelectedIndexChanged"> asp:ListItem ID="liInScope" runat="server" Value="true">In Scope (Monitored)</asp:ListItem> <asp:ListItem ID="liOutOfScope" runat="server" Value="true">Out of Scope (Unmonitored)</asp:ListItem> /asp:CheckBoxList> I have to store the value of the checkbox in session when they are cheked.

    Read the article

  • loading an asp after starting a session

    - by Noam Smadja
    the jQuery $("#loginform").submit(function(){ $.ajax({ type: "POST", url: "loginrespajax.asp", data: $("#loginform").serialize(), success: function(){ $("#loginform").hide("slow"); $("#loginform").load("userheader.asp"); $("#loginform").show("slow"); } }); }); thats userheader.asp <div class="userlinks"> <%if (session("userlevel")) then%> <% select case session("userlevel") case 1 %> <a href="managenews.asp"><%langstring("header_news")%></a> | <a href="managebooks.asp"><%langstring("header_books")%></a> | <a href="manageusers.asp"><%langstring("manage_users")%></a> | <a href="manageorders.asp"><%langstring("manage_orders")%></a> | <a href="managelanguage.asp"><%langstring("manage_language")%></a> | <a href="youthregistration.asp"><%langstring("youthreg_header")%></a> | <a href="manageregistrants.asp"><%langstring("youthlist_header")%></a> | <% case 2 %> <a href="managenews.asp"><%langstring("header_news")%></a> | <a href="managebooks.asp"><%langstring("header_books")%></a> | <a href="youthregistration.asp"><%langstring("youthreg_header")%></a> | <a href="manageregistrants.asp"><%langstring("youthlist_header")%></a> | <% case 3 %> <a href="youthregistration.asp"><%langstring("youthreg_header")%></a> | <a href="manageregistrants.asp"><%langstring("youthlist_header")%></a> | <% End select %> <a href="editprofile.asp"><%langstring("editprofile_header")%></a> | <a href="changepassword.asp"><%langstring("changepassword_header")%></a> | <a href="logout.asp"><%langstring("logout_header")%></a> <%else%> <form action="loginrespajax.asp" method="POST" name="loginform" id="loginform" class="loginform" onSubmit="return false;"> <input type="text" name="username" value="username" class="input inline" onFocus="clearText(this);"> <input type="password" name="password" value="password" class="input inline" onFocus="clearText(this);"> <input type="submit" value="Log In" class="submit inline"> </form> <%End if%> </div> i am submiting the login form using AJAX and the jQuery partially works. it does hide and show again. but it prints the ELSE part of in userheader.asp. the session does start, for sure :)

    Read the article

  • Customer session is different in different parts of a Magento website

    - by Josh Pennington
    I have a function inside of a Helper in Magento that returns whether or not a customer attribute equals one. Here is my Helper class class Nie_Nie_Helper_Data extends Mage_Core_Helper_Abstract { public function isNieAdmin() { if(Mage::getSingleton('customer/session')->getCustomer()->getNieAdmin() == 1) { return true; } else { return false; } } } Now when I call this function from a class that extends Mage_Core_Block_Template, everything seems to work fine. However when I try to use this inside one of my controllers, it does not work. In fact when I do Mage::getSingleton('customer/session')-getCustomer()-debug() the only variable that is returned is the website_id. Does anyone know what I have to do in order to get this to work? Thanks Josh Pennington

    Read the article

  • NHibernate filters don't work with Session.Get

    - by Khash
    I'm trying to implement a Soft-deletable repository. Usually this can be easily done with a Delete Event listener. To filter out the deleted entities, I can add a Where attribute to my class mapping. However, I also need to implement two more methods in the repository for this entity: Restore and Purge. Restore will "undelete" entities and Purge will hard-delete them. This means I can't use Where attribute (since it block out soft-deleted entities to any access) I tried using filters instead. I can create a filter and enable or disable it within session to achieve the same result. But the problem is filters don't have any effect on Session.Get method (they only affect ICriteria based access). Any ideas as to how solve this problem? Thanks

    Read the article

  • Does PHP session conflict with Share-Nothing-Architecture?

    - by Morgan Cheng
    When I first meet PHP, I'm amazed by the idea Sharing-Nothing-Architecture. I once in a project whose scalaiblity suffers from sharing data among different HTTP requests. However, as I proceed my PHP learning. I found that PHP has sessions. This looks conflict with the idea of sharing nothing. So, PHP session is just invented to make counterpart technology of ASP/ASP.NET/J2EE? Should high scalable web sites use PHP session?

    Read the article

  • ASP.NET Session and target blank

    - by Lennart
    Hi I have seen a few posts regarding Session and using target blank to open a new page. But I still don´t get it. Im working with an application which opens from a link on an Intranet site. I guess it uses target blank to get it in a new window. (I don´t have the source). If both windows are closed (My application and the Intranet site) it seems like the Session is destroyed. I need that to happen when my application is closed. (ie, still leaving the Intranet site open). If I use the site in my testenvironment without opening it from a page with target blank, it seems like I get the expected behaviour. Web.config has: pages enableSessionState="true" Thanks

    Read the article

  • session is lost after successful login?

    - by sword101
    greetings all um using spring security 3.0.2,all the application pages are secured to see them you must be authenticated um using https protocol i have a strange problem that after successful login and got to the requested page when try to open any link to other pages in the application the session is invalidated or lost or what happened i don't know and the user become anonymous,and redirected to the login page and i got this from debugging: No HttpSession currently exists No SecurityContext was available from the HttpSession: null. A new one will be created. after reviewing the coe many times,nothing in the code is invalidating the session,any ideas why something like this might happen?

    Read the article

  • asp.net session error

    - by umeshchaurasia
    HI all, I am working with asp.net with c#.net Here i am using session state to pass the value from one page to another. i have two pages, in first page i am calculating the value and passing the value to second page using session and in second page i am displaying the message through the value. I am using these two pages for facebook application. I uploaded my two pages then i am checking with facebook by opening through internet explorer and its giving below error. Object reference not set to an instance of an object. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.NullReferenceException: Object reference not set to an instance of an object. But when i open my application using firefox the pages are working fine. please help me...

    Read the article

  • Passing session data to ModelForm inside of ModelAdmin

    - by theactiveactor
    I'm trying to initialize the form attribute for MyModelAdmin class inside an instance method, as follows: class MyModelAdmin(admin.ModelAdmin): def queryset(self, request): MyModelAdmin.form = MyModelForm(request.user) My goal is to customize the editing form of MyModelForm based on the current session. When I try this however, I keep getting an error (shown below). Is this the proper place to pass session data to ModelForm? If so, then what may be causing this error? TypeError at ... Exception Type: TypeError Exception Value: issubclass() arg 1 must be a class Exception Location: /usr/lib/pymodules/python2.6/django/forms/models.py in new, line 185

    Read the article

  • Java session facade not being found via InitialContext lookups

    - by Hugh Buchanan
    I have a project that is Java EE 5 running on Glassfish. The IDE is Netbeans 6.7.1. We periodically have a very annoying problem with new session facades not being located via InitialContext: javax.naming.NameNotFoundException: No object bound to name java:comp/env/GlobalConfigEntityFacadeLocal In my class (within the same EJB container), I can use the other session facades just fine. This sort of problem happens periodically, and a mixture of clean&build and deleting the build-impl.xml files from nbproject sometimes resolve this. We are not using ejb-jar.xml (stopped using that over a year ago, it is now an empty The code that is calling this is very straight forward: GlobalConfigEntityFacadeLocal globalConfigEntityFacade = null; try { InitialContext ic = new InitialContext(); globalConfigEntityFacade = (GlobalConfigEntityFacadeLocal) ic.lookup("java:comp/env/GlobalConfigEntityFacadeLocal"); ... } catch ( ... ) {} Any advice would be appreciated!!!! Cheers

    Read the article

< Previous Page | 71 72 73 74 75 76 77 78 79 80 81 82  | Next Page >