Search Results

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

Page 93/632 | < Previous Page | 89 90 91 92 93 94 95 96 97 98 99 100  | Next Page >

  • How and when to log account access login with PHP?

    - by Nazgulled
    I want to implement a basic login system in some PHP app where no cookies will be involved. I mean, the user closes the browser and the login expires, it will remain active during the browser session (or if the user explicitly logs out) otherwise. I want to log all this activity and I'm thinking that every time the user refreshes the page, opens a different link or logs out, I record that time as the last access made by that user, overwriting the previous access log. But my problem is when and how should I insert another record into the database instead of overwriting the last one? Should I just define a timeout and if the last access was made above that timeout, another log should be inserted into the database? Should the session expire too after that timeout? Or is there a better way? Ideally, I would like to log the "log out action" when the browser was closed, but I don't think there's a way to detect that is there? Suggestions?

    Read the article

  • Make user object available to all Controllers in Zend?

    - by Sled
    Hey guys, I'm using Zend_Auth to identify a user in my application. This creates a session with the userobject. My question is how do I make this object available to every Controller and action, so I don't have to pull it out of the session every time I need data from this object? I'm guessing this should be done in bootstrap.php or index.php but I don't really know how to makte it available to every controller.. so any code examples would be appreciated! Thanks!

    Read the article

  • PHP Captcha without session

    - by Anton N
    Ok, here is an issue: in the project i'm working on, we can't rely on server-side sessions for any functionality. The problem is that common captcha solutions from preventing robotic submits require session to store the string to match captcha against. The question is - is there any way to solve the problem without using sessions? What comes to my mind - is serving hidden form field, containing some hash, along with captcha input field, so that server then can match these two values together. But how can we make this method secure, so that it couldn't be used to break captcha easily.

    Read the article

  • In grails how to insert additional parameters (from session) in all url's

    - by HeDinges
    I would like to add an additional parameter in my url, the use case is the following: When user do their login they also specify a 'company' name and from that moment on, all urls should map to: /$company/$controller/$action/$id The main idea is to have the current company name available in all url's, have it bookmarkable, and not to have to pass the company name everywhere as a request parameter. Also, once users are logged in it is acceptable to have the chosen company name in session scope. What is the right way of inserting this parameter in all our urls? I tried to modify my UrlMappings mapping, but I didn't found a way to insert the company name. Thanks,

    Read the article

  • Sharing session (or cookie) using Grails acegi plugin

    - by firnnauriel
    Is it possible for two different Grails project, also having different domains, to share a session/cookie? Let's say I have 2 sites: www.mycompany.com, and, www.othercompany.com. Assume that both sites are having same domains, and same database and records too. What I want to know is if this code: authenticateService.userDomain() or even the authenticateService.isLoggedIn() will behave and return exactly the same object/result whether it is called in either of the site. Basically, what we need is a solution for sharing/identifying logged in user between two different sites. Need more details on how to implement this using acegi 0.5.2 and grails 1.2.1. Hoping for any leads on this. Thank you.

    Read the article

  • How do I stack Plack authentication handlers?

    - by Schwern
    I would like to have my Plack app try several different means of authorizing the user. Specifically, check if the user is already authorized via a session cookie, then check for Digest authentication and then fall back to Basic. I figured I could just enable a bunch of Auth handlers in the order I wanted them to be checked (Session, Digest, Basic). Unfortunately, the way that Plack::Middleware::Auth::Digest and Plack::Middleware::Auth::Basic are written they both return 401 if digest or basic auth doesn't exist, respectively. How is this normally dealt with in Plack?

    Read the article

  • Hudson build fails when a user logs out of RDP session

    - by sjohnston
    We are using Hudson to build mixed C++/Java projects with an Ant script. It is running in Tomcat 6, on a Win XP virtual machine. I have noticed recently that when a user logs off the machine (from a remote desktop session), builds that are currently running tend to suddenly fail without an error message. Has anyone encountered anything similar or have an idea what might be causing this effect? I can post additional information about our setup if needed, I'm just not sure what's relevant in this case.

    Read the article

  • session set for some Actions in Zend framework

    - by user202127
    I'm working on a website , in CV part users have some articles that only logged in users can download them.I want to make changes to the log in Action or preDispatch() to set session for guess users to download the articles, can some one tell me how it can be or give me some reference links. here is my preDispatch(): public function preDispatch() { $userInfo=$this->_auth->getStorage()->read(); $identity= $this->_auth->getIdentity(); if(!$this->_auth->hasIdentity()) { return $this->_helper->redirector('login','login'); } if(!isset($userInfo["member_id"]) || strlen($userInfo["member_id"])==0) { return $this->_helper->redirector('forbidden','login'); } $this->_accessType=2; }

    Read the article

  • Passing PHP session variable to AJAX URL

    - by user547794
    Hello, I am trying to pass a session variable into an AJAX loaded page. Here is the code I am using: jQuery(document).ready(function(){ $("#userdetail").click(function() { $.ajax({ url: "userdetail.php?id=<?php $_SESSION['uid']?>", success: function(msg){ $("#results").html(msg); } }); }); }); This is the HTML URL I had working, not sure how to get this into the AJAX call: userdetail.php?id=<?php $_SESSION['uid']?> I should also mention that if I manually pass in the userID it works fine url: "userdetail.php?id=1",

    Read the article

  • Rails - Dynamic cookie domains using Rack

    - by Tim B.
    I'm fairly new to Rails and Rack, but this guy had a seemingly straightforward write-up about using Rack to implement dynamic session domain middleware. The code looks good to and I've implemented it here on my local machine, but I'm still not able to transcend top level domains on a single login. Here's the middleware code: class SetCookieDomain def initialize(app, default_domain) @app = app @default_domain = default_domain end def call(env) host = env["HTTP_HOST"].split(':').first env["rack.session.options"][:domain] = custom_domain?(host) ? ".#{host}" : "#{@default_domain}" @app.call(env) end def custom_domain?(host) domain = @default_domain.sub(/^\./, '') host !~ Regexp.new("#{domain}$", Regexp::IGNORECASE) end end And then in environment.db: config.load_paths += %W(#{RAILS_ROOT}/app/middlewares) Lastly in production.db (and development.db): config.middleware.use "SetCookieDomain", ".example.org" Any help is greatly appreciated. EDIT: I'm running Rails 2.3.3 and Rack 1.0

    Read the article

  • Displaying objects based on if a user is logged in or not

    - by MaxMackie
    I'm learning about PHP sessions for user authentication on my website. I know how to restrict the viewing of a complete page using sessions (simply check if the 'uid' session variable is set and if it is, show content, if not redirect to an error). However I'm trying to figure out the best way to selectively show and hide different objects (div, text, images) based on if a user is logged in or not. Is it as simple as checking for the 'uid' session variable and displaying based on if it set or not? Is there a more efficient way of doing this id there are a lot of conditional elements on a page?

    Read the article

  • Warning: session_start(): Cannot send session cache limiter - headers already sent

    - by shyam
    I am receiving this warning in a page while I try starting the session. <?php session_start(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head> <title>Video</title> </head> -this is the part of the code. There are no characters (not even space) before the first line. This page is reached after logging in from another page, through redirection. Any help? (PHP version is 5.2)

    Read the article

  • What magical thing could be killing my Drupal session and anywhere from 15-45 minutes of activity?

    - by jini
    I am using a standard Drupal install hosted on a LAMP stack. My settings.php has the following set: ini_set('session.gc_probability', 1); ini_set('session.gc_divisor', 100); ini_set('session.gc_maxlifetime', 200000); ini_set('session.cookie_lifetime', 2000000); my php.ini file has: session.gc_probability = 1 session.gc_divisor = 1000 session.gc_maxlifetime = 1440 Also I have checked that the safe mode is off so that my settings.php file is able to override main php.ini variables. Also since the person can get log out at 15 minutes, it is making me wonder whether php.ini has anything to do with it anyways. I have combed through my code and it seems to work fine on my local host however on server it is having issues. Where else can i possibly check?????

    Read the article

  • PHP Session Array Value keeps showing as "Array"

    - by Nerathas
    Hello, When sending data from a form to a second page, the value of the session is always with the name "Array" insteed of the expected number. The data should get displayed in a table, but insteed of example 1, 2, 3 , 4 i get : Array, Array, Array. (A 2-Dimensional Table is used) Is the following code below a proper way to "call" upon the stored values on the 2nd page from the array ? $test1 = $_SESSION["table"][0]; $test2 = $_SESSION["table"][1]; $test3 = $_SESSION["table"][2]; $test4 = $_SESSION["table"][3]; $test5 = $_SESSION["table"][4]; What exactly is this, and how can i fix this? Is it some sort of override that needs to happen? Best Regards.

    Read the article

  • Pass a variable from javascript to php in the same session OnClickFunction

    - by MickyScion
    I was seeing through stackoverflow the solutions for this kind of problems but any of them are executing the code of javascript in the same session...please i want some help with this...i have this in my session <script> function show_alert() { var ProdAntes = document.getElementById("productoseleccionado").value; var CantAntes = document.getElementById("cantidadantes").value; var PrecAntes = document.getElementById("precioantes").value; var FecAntes = document.getElementById("fechaantes").value; var ProdAhora = document.getElementById("SoyaProductorProduccionProducto").value; var CantAhora = document.getElementById("SoyaProductorProduccionCantidadtm").value; var PrecAhora = document.getElementById("SoyaProductorProduccionPreciodolar").value; var FecAhora = document.getElementById("select_date").value; } </script> and in my html stuff i have this <?php echo $this->Form->create('SoyaProductorProduccion');?> <fieldset> <?php echo $this->Form->hidden('id', array('value' => $this->data['SoyaProductorProduccion']['id'])); echo $this->Form->input('operacion', array('type' => 'hidden', 'value'=>'Produccion')); //-------------------------------------------------------------- $productoseleccionado = $this->data['SoyaProductorProduccion']['producto']; echo $this->Form->input('productoseleccionado', array('type' => 'hidden','style'=>'width:500px; height:30px;','id' => 'productoseleccionado' , 'value' => $productoseleccionado)); echo $this->Form->input('producto', array( 'options' => array( $productoseleccionado => $productoseleccionado, 'Torta solvente de soya' => 'Torta solvente de soya', 'Torta solvente de girasol' => 'Torta solvente de girasol', 'Harina integral de soya' => 'Harina integral de soya', 'Harina de girasol' => 'Harina de girasol', 'Cascarilla de soya' => 'Cascarilla de soya', 'Cascarilla de girasol' => 'Cascarilla de girasol', 'Aceite de soya refinado' => 'Aceite de soya refinado', 'Aceite de soya crudo' => 'Aceite de soya crudo', 'Aceite de girasol refinado' => 'Aceite de girasol refinado', 'Aceite de girasol crudo' => 'Aceite de girasol crudo', ),'label'=>'Tipo de Producto' )); foreach ($soyacambiodolares as $soyacambiodolar): $dolar=$soyacambiodolar['SoyaCambioDolar']['cambio']; endforeach; echo $this->Form->input('cambio', array('type' => 'hidden','value' => $dolar)); //----------------------------------------------------------------------------- $cantidadantes = $this->data['SoyaProductorProduccion']['cantidadtm']; echo $this->Form->input('cantidadantes', array('type' => 'hidden','style'=>'width:500px; height:30px;', 'value' => $cantidadantes,'id' => 'cantidadantes')); echo $this->Form->input('cantidadtm', array('label' => 'Cantidad en tonelada(s) métrica(s) del producto (TM)','style'=>'width:500px; height:30px;')); //----------------------------------------------------------------------------- $precioantes = $this->data['SoyaProductorProduccion']['preciodolar']; echo $this->Form->input('precioantes', array('type' => 'hidden','style'=>'width:500px; height:30px;', 'value' => $precioantes,'id' => 'precioantes')); echo $this->Form->input('preciodolar', array('label' => 'Precio en Dolares Americanos por tonelada métrica (TM / $us)','style'=>'width:500px; height:30px;')); //----------------------------------------------------------------------------- ?> <table style="width: 600px"> <tr> <td > <?php //---------------------------------------------------------------- $fechaantes = $this->data['SoyaProductorProduccion']['fecharegistro']; echo $this->Form->input('fechaantes', array('type' => 'hidden','style'=>'width:500px; height:30px;', 'value' => $fechaantes, 'id' => 'fechaantes')); //---------------------------------------------------------------- echo $this->Form->input("fecharegistro", array( 'label' => '<strong>Periodo al que corresponde la declaración</strong>', 'type' => 'text', 'style' => 'width: 110px', 'class' => 'fl tal vat w300p', 'error' => false , 'id' => 'select_date')); ?> <?php echo $this->Html->div('datepicker_img w100p fl pl460p pa', $this->Html->image('datepicker_calendar_icon.gif'),array('id' => 'datepicker_img')); ?> <?php echo $this->Html->div('datepicker fl pl460p pa', ' ' ,array('id' => 'datepicker')); ?> </td> </tr> </table> <?php echo $this->Form->submit('Modificar Existencia', array('class' => 'form-submit', 'title' => 'Presione aqui para agregar datos', 'onclick' => 'return show_alert();')); ?> </fieldset> <?php echo $this->Form->end(); ?> my function is ok but i want these: when i click the submit button i want to compare wich field had been changed, and i want to create a chain of detailed changes like "change in the field 1, change in the fiel 2.--" and so on...and this has to be saved in my database so i have to pass to a variable in my php before saving...thanks!

    Read the article

  • Redirecting a page when session expires using asp.net mvc

    - by Naidu
    In my web.config file i have the following code: <system.web> <assemblies> <authentication mode="Forms"> <forms loginUrl="/Account/Login" slidingExpiration="true" timeout="1" /> </authentication> <sessionState timeout="1"></sessionState> </assemblies> </system.web> And I have main page Project and in that there will sub pages. I have given the [Authorize] attribute for each view index method. After the session complete when we select any view then the page inside the project main page will be redirecting. But I want the whole page to be redirected. Any Help is appreciated.

    Read the article

  • Help me with Php session vs Header redirect?

    - by python
    I have the following pages: *page1.php <?php if (isset($_GET['link'])) { session_start(); $_session['myvariable'] = 'Hello World'; header('Location: http://' . $_SERVER['SERVER_NAME'] . dirname($_SERVER['REQUEST_URI']) . '/page2.php'); exit; } ?> <a href="<?php print $_SERVER['REQUEST_URI'] . '?link=yes';?>">Click Here</a> *page2.php <?php print 'Here is page two, and my session variable: '; session_start(); print $_session['myvariable']; //This line could not output. exit; ?> When I try output $_session['myvariable'] I did not get the result hello world message. I could not find out the solution to fix it .?

    Read the article

  • Java: Best approach to have a long list of variables needed all the time without consuming memory?

    - by evilReiko
    I wrote an abstract class to contain all rules of the application because I need them almost everywhere in my application. So most of what it contains is static final variables, something like this: public abstract class appRules { public static final boolean IS_DEV = true; public static final String CLOCK_SHORT_TIME_FORMAT = "something"; public static final String CLOCK_SHORT_DATE_FORMAT = "something else"; public static final String CLOCK_FULL_FORMAT = "other thing"; public static final int USERNAME_MIN = 5; public static final int USERNAME_MAX = 16; // etc. } The class is big and contains LOTS of such variables. My Question: Isn't setting static variables means these variables are floating in memory all the time? Do you suggest insteading of having an abstract class, I have a instantiable class with non-static variables (just public final), so I instantiate the class and use the variables only when I need them. Or is what am I doing is completely wrong approach and you suggest something else?

    Read the article

  • Multiple sessions or one?

    - by user1314285
    I am using a security token for a form, the form is dynamically built depending on selection through jquery. So the form is called quite a lot and different tokens created every-time. So.. if the same user calls the form 3 times the session would be rewritten? Would it help at all to check if the token exists and not create one unless its empty? or perhaps someone knows of a good way to work with form tokens? If 3 users are on then the token is created 3 times with different values, right? If I check for the token and 3 users are on then the session is created 3 times with the same values?

    Read the article

  • Access variables between nested JSP tags

    - by user308053
    I would like to exchange information between two nested JSP tagx artifacts. To give an example: list.jspx <myNs:table data="${myTableData}"> <myNs:column property="firstName" label="First Name"/> <myNs:column property="lastName" label="Last Name"/> </myNs:table> Now, the table.tagx is supposed to display the data columns as defined in the nested column tags. The question is how do I get access to the values of the property and label attributes of the nested column tags from the table tag. I tried jsp:directive.variable but that seems only to work to exchange information between a jsp and a tag, but not between nested tags. Note, I would like to avoid using java backing objects for both the table and the column tags at all. I would also like to know how I can access an attribute defined by a parent tag (in this example I would like to access the contents of the data attribute in table.tagx from column.tagx). So it boils down to how can I access variables between nested JSP tags which are purely implemented through the tag definitions themselves (no Java TagHandler implementation desired)?

    Read the article

  • Expose NativeActivity Variables to Workflow Designer

    - by sixlettervariables
    I've got a NativeActivity which contains an Activity body. The purpose of this activity is to expose a resource for the duration of the child activity as a Variable. The problem I've encountered is it appears the Variable cannot be used outside the activity. I'll use StreamReader as an example resource. ResourceActivity.cs: [Designer(typeof(ResourceActivityDesigner))] public sealed class ResourceActivity : NativeActivity { [RequiredArgument] public InArgument<string> Path { get; set; } [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] public Activity Body { get; set; } [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] public Variable<StreamReader> Resource { get; set; } public ResourceActivity() { this.Resource = new Variable<StreamReader> { Default = null, Name = "reader" }; } protected override void CacheMetadata(NativeActivityMetadata metadata) { if (this.Path != null) metadata.AddArgument(this.Path); if (this.Body != null) metadata.AddChild(this.Body); if (this.Resource != null) metadata.AddVariable(this.Resource); } protected override void Execute(NativeActivityContext context) { this.Resource.Set(context, new StreamReader(this.Path.Get(context))); context.ScheduleActivity(this.Body, new completionCallback(Done), new FaultCallback(Faulted)); } private void Done(NativeActivityContext context, ActivityInstance instance) { var reader = this.Reader.Get(context); if (reader != null) reader.Dispose(); } private void Faulted(NativeActivityFaultContext context, Exception ex, ActivityInstance instance) { var reader = this.Reader.Get(context); if (reader != null) reader.Dispose(); } } I cannot view "Resource" or "reader" in the Variables list in the Workflow Designer. Am I missing something in CacheMetadata?

    Read the article

  • Design approach, string table data, variables, stl memory usage

    - by howieh
    I have an old structure class like this: typedef vector<vector<string>> VARTYPE_T; which works as a single variable. This variable can hold from one value over a list to data like a table. Most values are long,double, string or double [3] for coordinates (x,y,z). I just convert them as needed. The variables are managed in a map like this : map<string,VARTYPE_T *> where the string holds the variable name. Sure, they are wrapped in classes. Also i have a tree of nodes, where each node can hold one of these variablemaps. Using VS 2008 SP1 for this, i detect a lot of memory fragmentation. Checking against the stlport, stlport seemed to be faster (20% ) and uses lesser memory (30%, for my test cases). So the question is: What is the best implementation to solve this requirement with fast an properly used memory ? Should i write an own allocator like a pool allocator. How would you do this ? Thanks in advance, Howie

    Read the article

  • Get variables in c# from ajax call

    - by fzshah76
    I've got an Ajax call for log in here is the code: //if MOUSE class is clicked $('.mouse').click(function () { //get the form to submit and return a message //how to call the function var name = $('#name').val(); var pwd2 = $('#pwd2').val(); $.ajax({ type:"POST", url: "http://localhost:51870/code/Login.aspx", data: "{ 'name':'" + $('#name').val() + "', 'pwd':'" + $('#pwd2').val() + "' }", contentType: "application/json; charset=utf-8", dataType: "json", context: document.body, success: function () { //$(this).addClass("done"); $(this).hide(); $('.mouse, .window').hide(); } }); }); the problem is I can't seem to catch name and pwd variables in Login page's preinit event or page load event here is the code in c#: protected void Page_PreInit(object sender, EventArgs e) { //taking javascript argument in preinit event //from here I'll have to build the page for specific lookbook var name = Request.QueryString["name"]; var pwd = Request.QueryString["pwd"]; } protected void Page_Load(object sender, EventArgs e) { var name = Request.QueryString["name"]; var pwd = Request.QueryString["pwd"]; SignIn(name); } I can't seem to get username name and password in c# side, help is appreciated. Here is my final javascript code c# code remains the same: <script type="text/javascript"> $(document).ready(function () { //if MOUSE class is clicked $('.mouse').click(function () { var name = $('#name').val(); var pwd = $('#pwd').val(); $.ajax({ url: "http://localhost:51870/code/Login.aspx?name="+ name +"&pwd="+pwd, context: document.body, success: function () { //$(this).addClass("done"); $(this).hide(); $('.mouse, .window').hide(); } }); }); }); </script> Thanks Zachary

    Read the article

  • Hibernate limitations on using variables in queries

    - by sammichy
    I had asked the following question I have the following table structure for a table Player Table Player { Long playerID; Long points; Long rank; } Assuming that the playerID and the points have valid values, can I update the rank for all the players based on the number of points in a single query? If two people have the same number of points, they should tie for the rank. And received the answer from Daniel Vassalo (thank you). UPDATE player JOIN (SELECT p.playerID, IF(@lastPoint <> p.points, @curRank := @curRank + 1, @curRank) AS rank, IF(@lastPoint = p.points, @curRank := @curRank + 1, @curRank), @lastPoint := p.points FROM player p JOIN (SELECT @curRank := 0, @lastPoint := 0) r ORDER BY p.points DESC ) ranks ON (ranks.playerID = player.playerID) SET player.rank = ranks.rank; When I try to execute this as a native query in Hibernate, the following exception is thrown. java.lang.IllegalArgumentException: org.hibernate.QueryException: Space is not allowed after parameter prefix ':' Apparently this has been an open issue for the last couple of years, I want to know if the ranking query can be made to work either Without using any variables in the SQL query OR Using any workaround for Hibernate.

    Read the article

  • AJAX Callback and Javascript class variables assignments

    - by Gianluca
    I am trying to build a little javascript class for geocoding addresses trough Google Maps API. I am learning Javascript and AJAX and I still can't figure out how can I initialize class variables trough a callback: // Here is the Location class, it takes an address and // initialize a GClientGeocoder. this.coord[] is where we'll store lat/lng function Location(address) { this.geo = new GClientGeocoder(); this.address = address; this.coord = []; } // This is the geoCode function, it geocodes object.address and // need a callback to handle the response from Google Location.prototype.geoCode = function(geoCallback) { this.geo.getLocations(this.address, geoCallback); } // Here we go: the callback. // I made it a member of the class so it would be able // to handle class variable like coord[]. Obviously it don't work. Location.prototype.geoCallback = function(result) { this.coord[0] = result.Placemark[0].Point.coordinates[1]; this.coord[1] = result.Placemark[0].Point.coordinates[0]; window.alert("Callback lat: " + this.coord[0] + "; lon: " + this.coord[1]); } // Main function initialize() { var Place = new Location("Tokyo, Japan"); Place.geoCode(Place.geoCallback); window.alert("Main lat: " + Place.coord[0] + " lon: " + Place.coord[1]); } google.setOnLoadCallback(initialize); Thank you for helping me out!

    Read the article

< Previous Page | 89 90 91 92 93 94 95 96 97 98 99 100  | Next Page >