Skip to content
View in the app

A better way to browse. Learn more.

MagicDuel Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Function: Mds_Store_Sessdata

Featured Replies

[b]void[/b] mds_store_sessdata(string $value, [i]optional[/i] int $index);

Stores temporary data for the player.
There are 10 "boxes" for each player which you can work with to store data.
Each player's session storage is unique to them, but each editor works on them independently.
That means 2 different editors can store to index 1 but will not affect eachother.

[b]Parameters[/b]
The value is a string value that will be stored, to store other data types serialize it first.
Index indicates which box to store it in, there are 10 boxes numbered 0 to 9. The default is 0.

[quote]- stored data can be at most 200 chars long
- it is valid only until the user logs out
- its much faster and less intenstive on the server because it is not using database
- can be read/set only be the same user that opens the item (it is not shared among users)
- it is shared across all items edited by the same editor[/quote]

Update: The maximum character length is 250.

See the related function [url="http://magicduel.invisionzone.com/topic/7584-function-mds-retrieve-sessdata/"]mds_retrieve_sessdata()[/url].

Example 1:
[code]
mds_store_sessdata('bakery', 2);
mds_retrieve_sessdata(@vd, 2);
//@vd now has 'bakery'
[/code]

Example 2:
Serializing
[code]
@vd = array(
've' => uv('ve'),
'vp' => uv('vp'),
't' => time()
);

mds_store_sessdata(serialize(@vd));
mds_retrieve_sessdata(@va);
@va = unserialize(@va);
[/code]

Edited by Rendril

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Forum Statistics

  • Total Topics 17.5k
  • Total Posts 182.2k

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.