Search Results

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

Page 166/632 | < Previous Page | 162 163 164 165 166 167 168 169 170 171 172 173  | Next Page >

  • Most secure way to generate a random session ID for a cookie?

    - by ensnare
    I'm writing my own sessions controller that issues a unique id to a user once logged in, and then verifies and authenticates that unique id at every page load. What is the most secure way to generate such an id? Should the unique id be completely random? Is there any downside to including the user id as part of the unique id?

    Read the article

  • FlexBuilder 3 Linked folders not picking up as files.

    - by Jafin
    I am using Flex Builder 3 to write a flex component. I have created a real folder path \common. Under common I create a Linked Folder to Session. Session points to a shared source folder with a item with a namespace of common\Session\ClassName. When I go to compile the project FlexBuilder warns that it was unable to find the type. if I stop using Linked folders and create a physical \common\Session\ in my project and place SessionInfo.as in the folder then it works. just in case my textual explanation is a bit obscure here is the layout. \src\common\Session\SessionInfo.as namespace of SessionInfo is common.Session. If you need any further info just let me know.

    Read the article

  • Should I cast variables that use a typdef'd type?

    - by mesorismo
    If I have something like: typedef int MyType; is it good practice to cast the operands of an operation if I do something like this: int x = 5; int y = 6; MyType a = (MyType)(x + y); I know that I don't need to do that but wondering if it's better for intent/documentation/readability concerns.

    Read the article

  • How do I combine similar method calls into a delegate pattern?

    - by Daniel T.
    I have three methods: public void Save<T>(T entity) { using (new Transaction()) { Session.Save(entity); } } public void Create<T>(T entity) { using (new Transaction()) { Session.Create(entity); } } public void Delete<T>(T entity) { using (new Transaction()) { Session.Delete(entity); } } As you can see, the only thing that differs is the method call inside the using block. How can I rewrite this so it's something like this instead: public void Save<T>(T entity) { TransactionWrapper(Session.Save(entity)); } public void Create<T>(T entity) { TransactionWrapper(Session.Create(entity)); } public void Save<T>(T entity) { TransactionWrapper(Session.Save(entity)); } So in other words, I pass a method call as a parameter, and the TransactionWrapper method wraps a transaction around the method call.

    Read the article

  • Can you pass _POST variables from 1 server to another?

    - by Dr. DOT
    I have a web form on an IIS server (has no PHP). I have a PHP script on a LAMP server. My _POST var array is coming up empty on the LAMP server. My suspicion is I cannot pass POST vars from 1 server to another but I would like to have that confirmed. Does anyone know the answer to this? If that's the case then I know I need to with use _GET vars in the URL's Query String or set a cookie (which I can do because both servers are config'd with the domain name). Thanks for your help.

    Read the article

  • Use variables to decide which object in an array gets an attribute?

    - by DavidR
    I have a web app which has two text areas. When one text area receives a mousedown event, a variable "side" is set, either "left" or "right." When a user selects some text in a text area, three strings are made. One for the text before the beginning of the selection, the selection itself, and the text after the selection to the end. A function is set to return these like this: return { head: head_text, tail: tail_text, sel: sel_text, side: text_side } Now, I have created an array, and I want it to appear in such a way that we get, text.left({"head":"four score", "selection":"and seven", "tail":"years ago."}) I am assuming I would do this by text.side = getSelection(), but how do I get it to evaluate the variable "side" instead of thinking of it as an object within "text"? EDIT: Ok, just to clarify, I might be completely wrong in my ideas in how this works, but here it goes. I want to make it so that a function can look at "text" see within text two objects, "left" and "right," and then evaluate the head, sel, and tail of each object. Would it be easier for me to use two objects?

    Read the article

  • Why wasn't C# designed with 'const' for variables and methods?

    - by spoulson
    I suspect const was simplified for the C# spec for general language simplicity. Was there a specific reason we can't declare variable references or methods as const like we can with C++? e.g.: const MyObject o = new MyObject(); // Want const cast referenece of MyObject o.SomeMethod(); // Theoretically legal because SomeMethod is const o.ChangeStuff(); // Theoretically illegal because ChangeStuff is not const class MyObject { public int val = 0; public void SomeMethod() const { // Do stuff, but can't mutate due to const declaration. } public void ChangeStuff() { // Code mutates this instance. Can't call with const reference. val++; } }

    Read the article

  • Why doesn't Rails' "errors.full_messages" replace attribute and message variables?

    - by tybro0103
    Having a strange problem with a rails model I just created. Here are my validations: validates_presence_of :from_name, :message => 'Please provide a from name.' validates_presence_of :from_email validates_presence_of :giftition_plan_id I'm having issues using errors.full_messages as well as f.error_messages in my form: g = Giftition.create g.errors.first => ["from_name", "Please provide a from name."] >> g.errors.full_messages => ["{{attribute}} {{message}}", "{{attribute}} {{message}}", "{{attribute}} {{message}}"] I'm just getting "{{attribute}} {{message}}". Any ideas? UPDATE: I've uninstalled rails 3 and all the gems that were installed with it and that made the problem go away. It's not a fix though... I would still like to have rails 3 installed.

    Read the article

  • How to tell if running in a linux console versus an ssh session?

    - by Stéphane
    I have an application that needs to behave differently if run directly from the linux console. So if a user connects with SSH to run FooBar, or the user walks over to the console and logs in directly to run FooBar, I want it to do something different. What C API do I need to call to tell the difference between these two scenarios? I was thinking I'd have to look at the "tty/pts" information (such as what I see when I run "ps axf"), but I'm not certain if that is the best solution, nor what API to call to get that information. Hints appreciated. :)

    Read the article

  • to avoid page refresh during button click event in asp.net

    - by ush
    public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) // If page loads for first time { Session["update"] = Server.UrlEncode(System.DateTime.Now.ToString()); // Assign the Session["update"] with unique value //=============== Page load code ========================= //============== End of Page load code =================== } } protected void Button1_Click(object sender, EventArgs e) { if (Session["update"].ToString() == ViewState["update"].ToString()) // If page not Refreshed { //=============== On click event code ========================= Label1.Text = TextBox1.Text; //lblDisplayAddedName.Text = txtName.Text; //=============== End of On click event code ================== // After the event/ method, again update the session Session["update"] = Server.UrlEncode(System.DateTime.Now.ToString()); } else // If Page Refreshed { // Do nothing } } protected override void OnPreRender(EventArgs e) { ViewState["update"] = Session["update"]; } } this is not working for high resolution gradient background

    Read the article

  • Javascript style variables with "-" in their name aren't able to be changed?

    - by William
    Okay, so this bug has cost me quite a bit of time and embarrassment. It seems that any style variable with a - in it's name can't be modified by javascript. As seen here: <!DOCTYPE html> <html lang="en"> <head> <title>Class Test</title> <meta charset="utf-8" /> <style> body { text-align: center; background-color: #ffffff;} #box { position: absolute; left: 610px; top: 80px; height: 50px; width: 50px; background-color: #ff0000; color: #000000;} </style> <script type="text/javascript"> var box = 0; </script> </head> <body> <div id="box" ></div> <script type="text/javascript"> box = document.getElementById('box'); box.style.background-color = "#0000ff"; </script> </body> </html> The box in said example will just remain red. So how do I change a style variable with a - in it's name?

    Read the article

  • Is there a way to access Joomla 1.5 user variables (like user id) from a Flex 4 application using a PHP Data Service?

    - by Zachary G. Schroeder
    I have written a script (in two files) that correctly displays a Joomla user id, like this: //this is testy.php define( '_JEXEC', 1 ); define('JPATH_BASE', dirname(FILE)); define( 'DS', DIRECTORY_SEPARATOR ); require_once ( JPATH_BASE .DS.'includes'.DS.'defines.php' ); require_once ( JPATH_BASE .DS.'includes'.DS.'framework.php' ); $mainframe =& JFactory::getApplication('site'); $id = JFactory::getUser()-id; The above file is located in the Joomla root folder. The other file is in a different directory and is as follows: //this is testid.php include '../../joomla/testy.php'; echo $id; However, and here is the rub, when I change the "echo" to a "return" and put the second code snippet inside my Flex 4 Data Service script file, like this... function getUserId() { include '../../joomla/testy.php'; return $id; } ...I get a Flex error that says this: Fatal error: Class 'JRequest' not found in /var/www/html/joomla/libraries/joomla/import.php on line 33 I am extremely confused by this error and would appreciate any suggestions that the stackoverflow community may have. Thanks so much! Zach

    Read the article

  • Why are awkward numbers and letters in my query string??

    - by Nicole
    Hi everyone!! I have a MVC website and when I execute it, the query string (url) that appears is: http://localhost:6970/(S(51aegi45qneolxa0oxwuzh55))/default.aspx what the hell is that strange combination of numbers and letters??? please help!!!!! previously i had been working with the session expires to redirect to one of my views, could be something of that?? i have added the following action filter: public override void OnActionExecuting(ActionExecutingContext filterContext) { HttpContextBase ctx = filterContext.HttpContext; // check if session is supported if (ctx.Session != null) { // check if a new session id was generated if (ctx.Session.IsNewSession) { // If it says it is a new session, but an existing cookie exists, then it must // have timed out string sessionCookie = ctx.Request.Headers["Cookie"]; if ((null != sessionCookie) && (sessionCookie.IndexOf("ASP.NET_SessionId") >= 0)) { filterContext.HttpContext.Response.Redirect("~/Error/SesionExpirada", true); } } } base.OnActionExecuting(filterContext); } but if I put it in ignore it stills add that rare thing to my urls. Please help!!! thanks

    Read the article

  • restrict the scope of variables in a mysql query? with brackets?

    - by Haroldo
    I can't remember what the method is meant to be for ensuring the scope of a variable in a query is restricted to prevent mysql injection. where should i put brackets in the following examples? UPDATE table SET col_1 = '$var', col_2 = '$var2' WHERE col_1 = '$var3' and SELECT * FROM table WHERE WHERE col_1 >= '$var1' (Obviously looking for answers not using PDO!)

    Read the article

< Previous Page | 162 163 164 165 166 167 168 169 170 171 172 173  | Next Page >