Title: dynamic link update per session
Last modified: February 28, 2018

---

# dynamic link update per session

 *  [javafiend](https://wordpress.org/support/users/javafiend/)
 * (@javafiend)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/dynamic-link-update-per-session/)
 * I want certain links on my site to change for either each session or after one
   has been clicked.
 * For example: link a points to google.com for session 1, on session 2 I want link
   a to point to yahoo.com.
 * Alternatively: link a points to google.com. When user 1 clicks on it, user 1 
   continues to google.com. For user 2, the link now points to yahoo.com. If user
   2 does not click, then the link continues to point to yahoo.com.
 * I hope that makes sense. Anyway, I’m sure there is a way to do this programmatically,
   but I’m hoping someone can point me to a plugin that might do it also. I have
   considered some of the ad rotator plugins, but I’m not sure if they would do 
   the job.
 * Hopefully, someone can help. Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [RossMitchell](https://wordpress.org/support/users/rossmitchell/)
 * (@rossmitchell)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/dynamic-link-update-per-session/#post-10022491)
 * I would forget about the session concept, and only resolve the link target when
   it is clicked. Capture the onclick event in javascript and have it do an AJAX
   request to your website to get the target URL. The .php file that receives the
   AJAX call updates an index in the database and returns as text the url obtained
   by indexing into an array or table indexed modulo the table size.
    This way every
   click serves out a different url in rotation.
 *  [polanskimortalio](https://wordpress.org/support/users/polanskimortalio/)
 * (@polanskimortalio)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/dynamic-link-update-per-session/#post-10022727)
 * About a year ago, I was planning to launch a [train ticket](https://mrbilit.com/train-ticket)
   purchase website that I encountered this problem in the middle of the work, and
   since I did not know if I could get help from the WordPress forum, I had to start
   the website….

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘dynamic link update per session’ is closed to new replies.

## Tags

 * [php](https://wordpress.org/support/topic-tag/php/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 3 participants
 * Last reply from: [polanskimortalio](https://wordpress.org/support/users/polanskimortalio/)
 * Last activity: [8 years, 2 months ago](https://wordpress.org/support/topic/dynamic-link-update-per-session/#post-10022727)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
