Cookies - How To Manage States Of A Web Games
Nov 3, 2010
Say I need to develop a online cheese games and the game is just between computer and a real human player.
The req is to keep states (like steps,win history) usable even after the user closing browsers or server temp being offline in short time. Thus when the player goes back to the game page, he should be keep playing from what he played last time, and get his play history as well.
It is definitely need cookie to enable all this, but i m concerning about the security of using that. I should prevent ppl hacking the cookie directly to change the history or sth. My thought is to make the server end assign a token to client. All the steps and history data are associated with this token string and stored in a persistent layer (database).
Is it a overdesign , or there is a way to encrypt cookies.
View 3 Replies
Similar Messages:
Jan 5, 2011
I have a little problem with my sliding panels, I have a Page with 2 sliding panels (right and left). These panels have a 'slide button' and you can reduce panels by clicking on it. I use cookies to record state of panel, so when you change page panels stay collapsed or extended. But it doesn't work very well, in fact the state is recorded for the page. If I change page, panel will extend (default position) but if I go back on the page it will disapear. Is it possible to ignore the path in the cookie and use a cookie for all website?
Jquery code :
$('#rightfold').click(function () {
if ($('.menudroite').is(':visible')) {
$('.menudroite').hide("slide", { direction: "right" }, 400);
$.cookie('rightfold', 'collapsed');
$('.triggerdroite').animate({ backgroundColor: "#B2C9D1" }, 1000);
$('#rightfold').animate({ color: "#000000" }, 1000);
}
else {
$('.menudroite').show("slide", { direction: "right" }, 400);
$.cookie('rightfold', 'extended');
$('.triggerdroite').animate({ backgroundColor: "#6c7a7f" }, 1000);
$('#rightfold').animate({ color: "#d9f4ff" }, 1000);
}
});
$('#leftfold').click(function () {
if ($('.menugauche').is(':visible')) {
$('.menugauche').hide("slide", { direction: "left" }, 400);
$.cookie('leftfold', 'collapsed');
$('.triggergauche').animate({ backgroundColor: "#B2C9D1" }, 1000);
$('#leftfold').animate({ color: "#000000" }, 1000);
}
else {
$('.menugauche').show("slide", { direction: "left" }, 400);
$.cookie('leftfold', 'extended');
$('.triggergauche').animate({ backgroundColor: "#6c7a7f" }, 1000);
$('#leftfold').animate({ color: "#d9f4ff" }, 1000);
}
});
// COOKIES
var leftfold = $.cookie('leftfold');
var rightfold = $.cookie('rightfold');
// Set the user's selection for the left column
if (leftfold == 'collapsed') {
$('.menugauche').css("display", "none");
};
// Set the user's selection for the right column
if (rightfold == 'collapsed') {
$('.menudroite').css("display", "none");
};
View 2 Replies
Jul 17, 2010
I have developed some web sites using asp.net and vb.net plus sql server. Now I aim to make a web site where people can play low-tech games (think online scrabble, typing one word at a time and sumitting it, maybe against the clock and maybe against an opponent).
Generally this would probably be done using Java, but would it be possible to do this kind of thing using asp.net and ajax?
View 4 Replies
Oct 22, 2010
I was asked to design an online game of cards (eg poker) multiplayer technology with asp.net mvc, and I went to see other sites like that have asked me. I noticed that many sites dump the game on the platform and then winform can play safely. I thought of using WCF and Silverlight together with asp.net mvc. How to understand the technology associated with the WCF card games online, where can I find examples of online games of cards?
View 1 Replies
Nov 22, 2010
I've developed a flash utility for a game portal that i'm building. The swf reads an xml file that contains the most played games. It works on the laptop but in the website
View 1 Replies
Jan 17, 2010
I'm building sport game and i really have hard time to find the correct formula of how to automate the building of each league games structure.leagues can come in various number of teams (eg. 4, 6,8,10...)each season is built from two round and in each round every team playing one match against each other.to make it even harder each team should play every second match in its own Arena...so if league is built from 4 teams it should be something like
Code:
First half of the season:
Round 1
Team A Vs Team B
Team C Vs Team D
Round 2
Team A Vs Team C
Team D Vs Team B
Second Half of the Season
Round 1
Team C Vs Team A
Team B Vs Team D
Round 2
Team D Vs Team C
Team B Vs Team A
View 11 Replies
Aug 17, 2010
I'm handling cookies using JavaScript to store some values in my asp.net web application.I use document.cookie to save some values (converted into a lengthy string). But i want that value to be accessible across all the pages in my application.When i try to get that value from a different page, i get the values pertaining to the document in the current URL.
In short i save the value in the cookie in http://myapp/doc1.aspx and want to retrieve it in http://myapp/doc2.aspx
So is document.cookie is pertaining to a single document scope? How can i save/read cookies across the site?
Update.This is how i get and set cookies
function getCookie(c_name)
{
try{ [code]...
But i'm getting different values for the cookies in different pages.
View 2 Replies
May 3, 2010
i want a list of all countries and states for free interms of xml,html,word,doc,notepad, .sql format..
View 8 Replies
May 23, 2010
I have multiple nested GridView controls where I have one field/column that always have one of three values only (0, 1, and 2) and this is editable field. Now, instead of putting this field as a DropDownList for the end-user to choose either one of these values (0, 1, or 2), I am representing each value with a specific clickable image, so the user can click the image to switch among the mentioned field states (0, 1, or 2).
I managed to do this with ImageButton and AJAX. However, the volume of this field is too high, the page is quite big, and the end-user needs to do change the state/value of this field most frequently, which causing a flicking issue in the page and slowness (because the code is done by AJAX, so in the server side) where the customer is not accepting it.
how we can rectify this issue; for example using javascript coding (but I need to get the selected value from code-behind)? I found the AJAX Toolkit ToggleButtonExtender which is very good and not causing the flicking/slowness issue, but unfortunately, this ToggleButton has only two states while I need three states option.
View 2 Replies
Nov 11, 2010
Does ASP.net MVC Uses Session internally to store the states ?
Wil MVC faile across Webfarms if session not managed properly ?
View 6 Replies
Mar 11, 2011
For some reason my query is returning multiple states. It will return records for CA, TX, AZ. All I want is NY that's it and to me it looks really clear.
SELECT [name1], [name2], [mail_street1], [mail_street2], [mail_city], [mail_state], [mail_zip], [phone], [website] FROM [flat_list] WHERE (([rl] = 'x') OR ([rs] = 'x') AND ([mail_state] = 'NY')) ORDER BY [name1], [name2]
View 1 Replies
Jul 22, 2010
where can i get the script for the countries and there corresponding states of all over the world.
As by googling I could Only find the states of Uk and USA but I want the states of all over the world and there corresponding countries.
View 2 Replies
Feb 2, 2010
Does anyone know a better way to insert all us states?
insert
[tbl_state](state_txt)
select
[code]...
View 2 Replies
Apr 13, 2010
I really enjoy the flex states framework. You define a few states for your control, and then can set child controls to only appear in certain states. Check out this code:
<s:states>
<s:State name="signin"/>
<s:State name="register"/>
[code]...
View 1 Replies
Mar 4, 2010
I'm trying to create a User Registration page in ASP.NET and wondering what is the best way to get the list of up-to-date Countries and Cities? Are there any Web Services on the web that I can use to retrieve such information? If not, what are the options?
View 2 Replies
Apr 20, 2010
I have a country table that has a list of countries. However, instead of just displaying the list alphabetical, I need to list the United States first, and then all the other countries in Alphabetical order. My select statement is pretty simple, jsut don't know how to get the US listed first...
Select Country from tCountry order by Country
View 4 Replies
Nov 23, 2010
I have been experimenting with code that will clear all of the cookies in an HttpContext.Response.Initially, I used this:
DateTime cookieExpires = DateTime.Now.AddDays(-1);
for (int i = 0; i < HttpContext.Request.Cookies.Count; i++)
{
HttpContext.Response.Cookies.Add(
new HttpCookie(HttpContext.Request.Cookies[i].Name, null) { Expires = cookieExpires });
}
this will error with an OutOfMemoryException because the for loop never exits - each time you add a cookie to the Response, it also gets added to the `Request.
View 1 Replies
Apr 1, 2011
I know that if I have set a cookie on a previous request, it will show up in my Request.Cookies collection. I want to update my existing Cookie. Are the cookies from my Request.Cookies collection already copied to my Response.Cookies collection? Do I need to add a new cookie with the same key using Response.Cookies.Add(), or do I need to use Response.Cookies.Set()?
View 1 Replies
May 19, 2010
I need a dropdown to display respective states when specific country is selected similarly for cities. I kept 3 dropdowns for country, state and city with 3 different tables with primary, foreign key constraints and stored procedures. The Stored Procedure is as shown ALTER PROCEDURE [dbo].[Usp_countryselect]
WITH
EXECUTE AS CALLER
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SELECT [country_id], [country_name]
FROM country
Similarly for states and city.
The code for populate lists is as shown
public class PopulateLists
{
public int FillCountry(ref System.Web.UI.WebControls.DropDownList drpdown)
{
SqlDatabase db = new SqlDatabase();
DbCommand cmd=db.GetStoredProcCommand("USP_countryselect");
DataSet dsCountry= db.ExecuteDataSet(cmd);
drpdown.DataSource =dsCountry.Tables[0] ; drpdown.DataTextField=dsCountry.Tables[0].Columns["country_name"].ToString() ;
drpdown.DataValueField = dsCountry.Tables[0].Columns["country_id"].ToString() ;
drpdown.DataBind();
return 1;
}
public int FillState(ref System.Web.UI.WebControls.DropDownList drpdown)
{
SqlDatabase db = new SqlDatabase();
DbCommand cmd = db.GetStoredProcCommand("USP_statesselect");
DataSet dsStates = db.ExecuteDataSet(cmd);
drpdown.DataSource = dsStates.Tables[0];
drpdown.DataTextField = dsStates.Tables[0].Columns["state_name"].ToString();
drpdown.DataValueField = dsStates.Tables[0].Columns["state_id"].ToString();
drpdown.DataBind();
return 1;
}
.
.
.
}
protected void Page_Load(object sender, EventArgs e)
{
BindDropdowns();
}
protected void BindDropdowns()
{
PopulateLists objPopulateLists = new PopulateLists();
int bytReturn;
bytReturn = objPopulateLists.FillCountry(ref Drpcountry);
bytReturn = objPopulateLists.FillState(ref Drpstate);
bytReturn = objPopulateLists.FillCity(ref Drpcity);
}
But in the output screen it is displaying all the values in the dropdowns irrespective of country and state selection.
View 3 Replies
Mar 5, 2010
Can any one let me know "How to load the dynamcially added HTML Controls(Controls added using javascript) during the postbacks without loosing their values?
View 1 Replies
Mar 17, 2011
I built a user control that displays a drop down list of states. I'm using it, but if I try to put it in a listview control, all I get is the frop down with nothing in it.
View 3 Replies
Feb 9, 2011
I got 2 linq results, one of them is as follow.
[Code]....
I need to find out which states in the "query" are not included in the "query2".I can loop through 2 results with nested loop but I think there might be better way of doing the same task with LINQ.Please show me the right direction if it can be done.
View 5 Replies
Oct 6, 2010
HiMy web site uses 2 unmanaged DLLs (gsl.dll, cblas.dll). I put these dll's in the bin folder along with some other managed dll's. On my development system everything is fine when using the built-in dev server in Visual Studio 2010. However, when I run the site through my dev system's IIS instead of the Visual Studio server I get the following error:'C:<absolute path to bin folder>ingsl.dll': Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
View 8 Replies
Jan 6, 2011
I built a little web application that displays charts. I was thinking that it might be useful for the superuser of the app to do a complete data refresh, however this process takes around 10 minutes to complete. I was thinking perhaps the user could click a button that would start off a new thread to do a data refresh and subsequent clicks would kill the thread and restart the data population process. The user would then be free to browse about the site and view the charts as their data is populated.
Is there a simple method of accomplishing something like this?
View 3 Replies
Feb 3, 2011
I will like to imitate the behaviour of the site ClickBank.com, for example:Open the site, and login, if i open a tab with the same site, it ask me again to login.It makes me wonder how to manage one session per tab.Just to clarify, i don't loose control on the first tab if i log on in the new tab. They are separate sessions.
View 1 Replies