Make a cookie containing the Member's ID 5.6

Permalink
Hi All,

I need my site to set a cookie containing the Member's ID. This will be useful for other functions later but for now I want to test for the contents of the cookie within .htaccess

The purpose is, if the cookie does not exist or if it is set to a member ID of 0 then I want to turn off server caching (I'm using Litespeed LScache).

The reason for that is, if I use Litespeed LScache when a user is logged in, an incorrect username is displayed. The username displayed is for the user who was logged in when the cache was created.

So, I want to enable server caching only for guest users.

Hope you can help, I don't know how to set cookies from within C5 but I pretty much understand the rest!

Thanks,
Mike

designserve
 
designserve replied on at Permalink Reply
designserve
Correction. What I need is - In C5, all visitors have a session by default and a cookie called CONCRETE5. When any page loads, check whether the visitor is logged in. If they are logged in, create a cookie called LSUNCACHE. Give it a value of 1. If they are not logged in, expire the LSUNCACHE cookie for that session.

Therefore, for each visitor, using htaccess, I can check whether there is a CONCRETE5 cookie and an LSUNCACHE cookie with a value of 1. If there is no LSUNCACHE cookie, I can serve them the cached version of the page (static cache by Litespeed LScache). If they are logged in there will be a value of 1 in the LSUNCACHE cookie, so they will be served the uncached, live version (it will still have C5's own caching).

Does that logic sound right?

Anyone know how to create that cookie from within C5? **** C5.6 ****

Many thanks,
Mike
designserve replied on at Permalink Reply
designserve
Janks replied on at Permalink Reply
Janks
I need the exact same.

How to make it?