# how to delete apm session variable from another session

**URL:** <https://community.f5.com/t/how-to-delete-apm-session-variable-from-another-session/56394>\
**Category:** Technical Forums\
**Tags:** irules, big-ip-access-policy-manager-apm, session, security, devops, application-delivery\
**Created:** [August 19, 2014, 6:45am UTC](https://community.f5.com/t/how-to-delete-apm-session-variable-from-another-session/56394 "2014-08-19T06:45:32Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andrea\_Arquint\_1](https://avatars.discourse-cdn.com/v4/letter/a/85e7bf/32.png) [@Andrea\_Arquint\_1](https://community.f5.com/u/Andrea_Arquint_1)\
**Post date:** [August 19, 2014, 6:45am UTC](https://community.f5.com/t/how-to-delete-apm-session-variable-from-another-session/56394/1 "2014-08-19T06:45:32Z")

</div>

Hi, Is it possible to delete a dedicated variable via irule from another APM session? Thank you, sm

---

<div class="post-metadata">

**Author:** ![Yann\_Desmarest\_1](https://avatars.discourse-cdn.com/v4/letter/y/65b543/32.png) [@Yann\_Desmarest\_1](https://community.f5.com/u/Yann_Desmarest_1)\
**Post date:** [August 20, 2014, 7:31am UTC](https://community.f5.com/t/how-to-delete-apm-session-variable-from-another-session/56394/2 "2014-08-20T07:31:56Z")

</div>

Not sure you can delete an APM variable but you can for sure remove its value with the following command :

```tcl
ACCESS::session data set [-sid] [-secure] []

```

where sid is the Session ID and key is the variable name.

---

<div class="post-metadata">

**Author:** ![Andrea\_Arquint\_1](https://avatars.discourse-cdn.com/v4/letter/a/85e7bf/32.png) [@Andrea\_Arquint\_1](https://community.f5.com/u/Andrea_Arquint_1)\
**Post date:** [August 20, 2014, 12:06pm UTC](https://community.f5.com/t/how-to-delete-apm-session-variable-from-another-session/56394/3 "2014-08-20T12:06:45Z")

</div>

Yes just this works: ACCESS::session data set –sid

---

<div class="post-metadata">

**Author:** ![Andrea\_Arquint\_1](https://avatars.discourse-cdn.com/v4/letter/a/85e7bf/32.png) [@Andrea\_Arquint\_1](https://community.f5.com/u/Andrea_Arquint_1)\
**Post date:** [August 20, 2014, 12:08pm UTC](https://community.f5.com/t/how-to-delete-apm-session-variable-from-another-session/56394/4 "2014-08-20T12:08:14Z")

</div>

I mean it does work like this

```tcl
ACCESS::session data set –sid 12345678901234567234562345 session.logon.last.username “”

```

---

<div class="post-metadata">

**Author:** ![brad\_11480](https://avatars.discourse-cdn.com/v4/letter/b/8edcca/32.png) [@brad\_11480](https://community.f5.com/u/brad_11480)\
**Post date:** [October 2, 2014, 4:43pm UTC](https://community.f5.com/t/how-to-delete-apm-session-variable-from-another-session/56394/5 "2014-10-02T16:43:33Z")

</div>

I am trying to get session information for another session. When I use the sessiondump command i get 8 digit session numbers, but when i try to use them in a ACCESS::session data get -sid 12345678 it returns an error that the session doesn’t exist. from the above example the sid seems to be a much larger value. I’m curious what the sid value should be?

Then, is there a way to obtain the list of active sessions -- sessionid’s as I would like to roll through all active sessions and report some of the session information.

thank you.

---

<div class="post-metadata">

**Author:** ![Yann\_Desmarest\_1](https://avatars.discourse-cdn.com/v4/letter/y/65b543/32.png) [@Yann\_Desmarest\_1](https://community.f5.com/u/Yann_Desmarest_1)\
**Post date:** [October 2, 2014, 4:50pm UTC](https://community.f5.com/t/how-to-delete-apm-session-variable-from-another-session/56394/6 "2014-10-02T16:50:56Z")

</div>

hello,

the sid is the full MRHSession cookie value not just the last 8 digits (LastMRH\_Session)

---

<div class="post-metadata">

**Author:** ![Yann\_Desmarest\_1](https://avatars.discourse-cdn.com/v4/letter/y/65b543/32.png) [@Yann\_Desmarest\_1](https://community.f5.com/u/Yann_Desmarest_1)\
**Post date:** [October 2, 2014, 4:50pm UTC](https://community.f5.com/t/how-to-delete-apm-session-variable-from-another-session/56394/7 "2014-10-02T16:50:58Z")

</div>

hello,

the sid is the full MRHSession cookie value not just the last 8 digits (LastMRH\_Session)

---

<div class="post-metadata">

**Author:** ![Yann\_Desmarest\_1](https://avatars.discourse-cdn.com/v4/letter/y/65b543/32.png) [@Yann\_Desmarest\_1](https://community.f5.com/u/Yann_Desmarest_1)\
**Post date:** [October 2, 2014, 4:50pm UTC](https://community.f5.com/t/how-to-delete-apm-session-variable-from-another-session/56394/8 "2014-10-02T16:50:58Z")

</div>

hello,

the sid is the full MRHSession cookie value not just the last 8 digits (LastMRH\_Session)

---

<div class="post-metadata">

**Author:** ![Yann\_Desmarest](https://avatars.discourse-cdn.com/v4/letter/y/5fc32e/32.png) [@Yann\_Desmarest](https://community.f5.com/u/Yann_Desmarest)\
**Post date:** [October 2, 2014, 4:50pm UTC](https://community.f5.com/t/how-to-delete-apm-session-variable-from-another-session/56394/9 "2014-10-02T16:50:59Z")

</div>

hello,

the sid is the full MRHSession cookie value not just the last 8 digits (LastMRH\_Session)

---

<div class="post-metadata">

**Author:** ![Yann\_Desmarest\_1](https://avatars.discourse-cdn.com/v4/letter/y/65b543/32.png) [@Yann\_Desmarest\_1](https://community.f5.com/u/Yann_Desmarest_1)\
**Post date:** [October 2, 2014, 4:50pm UTC](https://community.f5.com/t/how-to-delete-apm-session-variable-from-another-session/56394/10 "2014-10-02T16:50:59Z")

</div>

hello,

the sid is the full MRHSession cookie value not just the last 8 digits (LastMRH\_Session)

---

<div class="post-metadata">

**Author:** ![Yann\_Desmarest\_1](https://avatars.discourse-cdn.com/v4/letter/y/65b543/32.png) [@Yann\_Desmarest\_1](https://community.f5.com/u/Yann_Desmarest_1)\
**Post date:** [October 2, 2014, 4:50pm UTC](https://community.f5.com/t/how-to-delete-apm-session-variable-from-another-session/56394/11 "2014-10-02T16:50:59Z")

</div>

hello,

the sid is the full MRHSession cookie value not just the last 8 digits (LastMRH\_Session)

---

<div class="post-metadata">

**Author:** ![brad\_11480](https://avatars.discourse-cdn.com/v4/letter/b/8edcca/32.png) [@brad\_11480](https://community.f5.com/u/brad_11480)\
**Post date:** [June 6, 2017, 7:40pm UTC](https://community.f5.com/t/how-to-delete-apm-session-variable-from-another-session/56394/12 "2017-06-06T19:40:50Z")

</div>

well, actually it seems that it only looks at the last 8 digits. seems anything can be used in the first 24 digits.. use z or x (doesn’t even have to be hex digits). So don’t be fooled thinking the 32 digit string is more secure or has any other significance…

why they require 32 digits when only 8 are used is strange…

---

<div class="post-metadata">

**Author:** ![brad\_11480](https://avatars.discourse-cdn.com/v4/letter/b/8edcca/32.png) [@brad\_11480](https://community.f5.com/u/brad_11480)\
**Post date:** [June 6, 2017, 7:40pm UTC](https://community.f5.com/t/how-to-delete-apm-session-variable-from-another-session/56394/13 "2017-06-06T19:40:50Z")

</div>

well, actually it seems that it only looks at the last 8 digits. seems anything can be used in the first 24 digits.. use z or x (doesn’t even have to be hex digits). So don’t be fooled thinking the 32 digit string is more secure or has any other significance…

why they require 32 digits when only 8 are used is strange…

---

<div class="post-metadata">

**Author:** ![Yann\_Desmarest\_1](https://avatars.discourse-cdn.com/v4/letter/y/65b543/32.png) [@Yann\_Desmarest\_1](https://community.f5.com/u/Yann_Desmarest_1)\
**Post date:** [June 13, 2017, 7:38pm UTC](https://community.f5.com/t/how-to-delete-apm-session-variable-from-another-session/56394/14 "2017-06-13T19:38:12Z")

</div>

Hi,

You can have a look at this article : [https://support.f5.com/csp/article/K15387](https://support.f5.com/csp/article/K15387)

They explain that the first 24 HEX digits is rotated during policy evaluation for security reasons.

I think that the MRHSession is really important when you are under policy evaluation. Once logged in, Last\_MRHSession is the only required cookie.

---

<div class="post-metadata">

**Author:** ![Yann\_Desmarest](https://avatars.discourse-cdn.com/v4/letter/y/5fc32e/32.png) [@Yann\_Desmarest](https://community.f5.com/u/Yann_Desmarest)\
**Post date:** [June 13, 2017, 7:38pm UTC](https://community.f5.com/t/how-to-delete-apm-session-variable-from-another-session/56394/15 "2017-06-13T19:38:12Z")

</div>

Hi,

You can have a look at this article : [myF5](https://support.f5.com/csp/article/K15387)

They explain that the first 24 HEX digits is rotated during policy evaluation for security reasons.

I think that the MRHSession is really important when you are under policy evaluation. Once logged in, Last\_MRHSession is the only required cookie.

---

<div class="post-metadata">

**Author:** ![brad\_11480](https://avatars.discourse-cdn.com/v4/letter/b/8edcca/32.png) [@brad\_11480](https://community.f5.com/u/brad_11480)\
**Post date:** [June 19, 2017, 6:33pm UTC](https://community.f5.com/t/how-to-delete-apm-session-variable-from-another-session/56394/16 "2017-06-19T18:33:23Z")

</div>

Good information. I’m using it after the session evaluation is complete and the session is underway, and the document does say: “After Access Policy evaluation, the session ID remains static.”. But the interesting part is that I can use the last 8 digits anything as the first 24 digits and it is successful-- it doesn’t have to match the value of the MRHSession cookie. I am, however, checking a full match with my code as I require it to match all 32 digits.

---

<div class="post-metadata">

**Author:** ![brad\_11480](https://avatars.discourse-cdn.com/v4/letter/b/8edcca/32.png) [@brad\_11480](https://community.f5.com/u/brad_11480)\
**Post date:** [June 19, 2017, 6:33pm UTC](https://community.f5.com/t/how-to-delete-apm-session-variable-from-another-session/56394/17 "2017-06-19T18:33:23Z")

</div>

Good information. I’m using it after the session evaluation is complete and the session is underway, and the document does say: “After Access Policy evaluation, the session ID remains static.”. But the interesting part is that I can use the last 8 digits anything as the first 24 digits and it is successful-- it doesn’t have to match the value of the MRHSession cookie. I am, however, checking a full match with my code as I require it to match all 32 digits.
