vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Variable Persist for User Session (https://vborg.vbsupport.ru/showthread.php?t=184018)

v0xb0x 06-30-2008 10:18 PM

Variable Persist for User Session
 
With the help of Opserty, Danny, MoT3rror and Dismounted, I was able to get a non-vBulletin page to pass in 3 values into a vBulletin page via the query string.

Great.

I now would like to have those 3 variables persist for the length of the users session.

Different users will have different values for these variables. Some users may have the same values as others as well.

Here's the question: Is there an easy way to invoke a 'persist' state for variables that are declared in a global_start plugin?

Opserty 06-30-2008 10:48 PM

<a href="https://vborg.vbsupport.ru/showthread.php?t=152344&highlight=session" target="_blank">[How-To] Extend and use the Session Table Effectively
</a> maybe?

MoT3rror 06-30-2008 10:52 PM

You can save the data in a cookie, session, or by the database.

v0xb0x 07-01-2008 12:10 AM

Quote:

Originally Posted by MoT3rror (Post 1563483)
You can save the data in a cookie, session, or by the database.

I think the easiest way to approach this is the use of the vbsetcookie.

Can someone step me through the high level implementation of this function?

For example, I have exposed the values I want to store in the cookie (3 int and 1 str) using the global_start hook.

Two questions:

1. Where should I use the vbsetcookie?
2. How do I call the value of vbsetcookie on the next page?

Thanks in advance for anyone's help.

Dismounted 07-01-2008 06:59 AM

Extending the session table would be more effective, IMO.


All times are GMT. The time now is 01:51 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01078 seconds
  • Memory Usage 1,716KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete