Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

[Done] Store username in vanilla's cookie?

edited October 2006 in Vanilla 1.0 Help
Hi there,

I'm using and therefore I need the username to be stored with the vanilla-cookie - is there an easy way to do this?



  • Options
    A_J did the same thing earlier, have a look at his extension.
  • Options
    edited October 2006
    Thanks for the hint!

    I made a small "extension" out of a_j's bigger one :-)

    Get it here if you want (updated)
  • Options
    MarkMark Vanilla Staff
    edited October 2006
    That extension will break. You need more checks in there, and you definitely don't need to set the cookie on every page load. Try this:

    if ($Context->Session->UserID > 0 && ForceIncomingCookieString('your_cookie_name', '') != $Context->Session->User->Name) { setcookie ("your_cookie_name", $Context->Session->User->Name, time()+604800); }
  • Options
    Thanks Mark!

    Changed the code to what you've written - the first thing worked for me, but not very effective I think...
  • Options
    what exactly does this do ? any benefit to using it ?
  • Options
    bugs, see first post
This discussion has been closed.