Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
Parag Negi
How to Redirect using cookie or anyother way.... Pease advise!
September 24, 2012 6:19 AM
Answer

Parag Negi

Rank: Junior Member

Posts: 29

Join Date: February 1, 2012

Recent Posts

Hi everyone.

I am trying to find a fix for an issue.
Scenario: We have a mobile community(with mobile pages) and user community(with desktop pages). So far we have setup a jquery/javascript cookie which works fine.
When user clicks on mobile link from Desktop page, the cookie is set to mobile and user sent to mobile home page. Vice versa for desktop.
Now when user goes to desktop age (when cookie is mobile)...the user is redirected, but this redirection takes few seconds...during which desktop page is loaded...and then after 1-2 seconds, user is sent to mobile home page.

As the jquery/javascript works on client side, it's no good, as unwanted page will be loaded for few seconds and then redirection will take place.

Is here any way to do this kind of work from server side.
Or may be use Expando here...(although i don't know how)

I am running this cookie friendly jquery in theme level...
I also want to working at login level also, so that when user has set cookie as mobile, user is directly taken to mobile, instead of redirecting through desktop.

Would really appreciate if any help can be given on this.

Thanks and Regards,
Parag